diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-03-22 16:38:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-22 16:38:32 -0400 |
commit | f467bdce1ba95e950b01f59ba284873137bca5d5 (patch) | |
tree | 34a249c2341216233d407c1e9c7a568698ccf5d5 /components/script/dom/window.rs | |
parent | c20d0c00d711cda61ad1b35f15f2fb563c042c5e (diff) | |
parent | 7d4e2b11e940545eaa74877b75908e1e02f6eeb5 (diff) | |
download | servo-f467bdce1ba95e950b01f59ba284873137bca5d5.tar.gz servo-f467bdce1ba95e950b01f59ba284873137bca5d5.zip |
Auto merge of #20132 - nakul02:issue_19223, r=jdm
Profiler for blocked IpcReceiver::recv()
<!-- Please describe your changes on the following line: -->
Implements feature #19223
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19223 (github issue number if applicable).
<!-- Either: -->
- [x] There are tests for these changes
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
WIP.
@jdm - this is the new profiler : "Blocked at IPC Receive"
Should I dig through all the calls to `ipc::channel` and replace them with this profiled `IpcReceiver`?

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20132)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r-- | components/script/dom/window.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 37f65f774b2..327e766e7fa 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -50,7 +50,7 @@ use dom::workletglobalscope::WorkletGlobalScopeType; use dom_struct::dom_struct; use euclid::{Point2D, Vector2D, Rect, Size2D, TypedPoint2D, TypedScale, TypedSize2D}; use fetch; -use ipc_channel::ipc::{self, IpcSender}; +use ipc_channel::ipc::IpcSender; use ipc_channel::router::ROUTER; use js::jsapi::{HandleValue, JSAutoCompartment, JSContext}; use js::jsapi::{JS_GC, JS_GetRuntime}; @@ -63,6 +63,7 @@ use net_traits::image_cache::{ImageCache, ImageResponder, ImageResponse}; use net_traits::image_cache::{PendingImageId, PendingImageResponse}; use net_traits::storage_thread::StorageType; use num_traits::ToPrimitive; +use profile_traits::ipc as ProfiledIpc; use profile_traits::mem::ProfilerChan as MemProfilerChan; use profile_traits::time::ProfilerChan as TimeProfilerChan; use script_layout_interface::{TrustedNodeAddress, PendingImageState}; @@ -540,7 +541,7 @@ impl WindowMethods for Window { stderr.flush().unwrap(); } - let (sender, receiver) = ipc::channel().unwrap(); + let (sender, receiver) = ProfiledIpc::channel(self.global().time_profiler_chan().clone()).unwrap(); self.send_to_constellation(ScriptMsg::Alert(s.to_string(), sender)); let should_display_alert_dialog = receiver.recv().unwrap(); @@ -1180,7 +1181,9 @@ impl Window { } fn client_window(&self) -> (TypedSize2D<u32, CSSPixel>, TypedPoint2D<i32, CSSPixel>) { - let (send, recv) = ipc::channel::<(DeviceUintSize, DeviceIntPoint)>().unwrap(); + let timer_profile_chan = self.global().time_profiler_chan().clone(); + let (send, recv) = + ProfiledIpc::channel::<(DeviceUintSize, DeviceIntPoint)>(timer_profile_chan).unwrap(); self.send_to_constellation(ScriptMsg::GetClientWindow(send)); let (size, point) = recv.recv().unwrap_or((TypedSize2D::zero(), TypedPoint2D::zero())); let dpr = self.device_pixel_ratio(); @@ -1300,7 +1303,8 @@ impl Window { let mut images = self.pending_layout_images.borrow_mut(); let nodes = images.entry(id).or_insert(vec![]); if nodes.iter().find(|n| &***n as *const _ == &*node as *const _).is_none() { - let (responder, responder_listener) = ipc::channel().unwrap(); + let (responder, responder_listener) = + ProfiledIpc::channel(self.global().time_profiler_chan().clone()).unwrap(); let pipeline = self.upcast::<GlobalScope>().pipeline_id(); let image_cache_chan = self.image_cache_chan.clone(); ROUTER.add_route(responder_listener.to_opaque(), Box::new(move |message| { |