mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implements profiler for blocked recv
This commit is contained in:
parent
563f0ec824
commit
7d4e2b11e9
27 changed files with 176 additions and 58 deletions
|
@ -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| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue