diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 70292acee1b..be827ff2ecf 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -17,11 +17,9 @@ use gleam::gl; use gleam::gl::types::{GLint, GLsizei}; use image::{DynamicImage, ImageFormat, RgbImage}; use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory}; -use ipc_channel::router::ROUTER; use msg::constellation_msg::{Key, KeyModifiers, KeyState, CONTROL}; use msg::constellation_msg::{PipelineId, PipelineIndex, PipelineNamespaceId, TraversalDirection}; use net_traits::image::base::{Image, PixelFormat}; -use profile_traits::mem::{self, Reporter, ReporterRequest}; use profile_traits::time::{self, ProfilerCategory, profile}; use script_traits::{AnimationState, AnimationTickType, ConstellationControlMsg}; use script_traits::{ConstellationMsg, LayoutControlMsg, LoadData, MouseButton}; @@ -184,9 +182,6 @@ pub struct IOCompositor { /// The channel on which messages can be sent to the time profiler. time_profiler_chan: time::ProfilerChan, - /// The channel on which messages can be sent to the memory profiler. - mem_profiler_chan: mem::ProfilerChan, - /// Touch input state machine touch_handler: TouchHandler, @@ -312,10 +307,6 @@ fn initialize_png(width: usize, height: usize) -> RenderTargetInfo { } } -fn reporter_name() -> String { - "compositor-reporter".to_owned() -} - struct RenderNotifier { compositor_proxy: Box, constellation_chan: Sender, @@ -368,23 +359,6 @@ impl webrender_traits::RenderDispatcher for CompositorThreadDispatcher { impl IOCompositor { fn new(window: Rc, state: InitialCompositorState) -> IOCompositor { - // Register this thread as a memory reporter, via its own channel. - let (reporter_sender, reporter_receiver) = ipc::channel() - .expect("Compositor reporter chan"); - let compositor_proxy_for_memory_reporter = state.sender.clone_compositor_proxy(); - ROUTER.add_route(reporter_receiver.to_opaque(), box move |reporter_request| { - match reporter_request.to::() { - Err(e) => error!("Cast to ReporterRequest failed ({}).", e), - Ok(reporter_request) => { - let msg = Msg::CollectMemoryReports(reporter_request.reports_channel); - compositor_proxy_for_memory_reporter.send(msg); - }, - } - }); - let reporter = Reporter(reporter_sender); - state.mem_profiler_chan.send( - mem::ProfilerMsg::RegisterReporter(reporter_name(), reporter)); - let window_size = window.framebuffer_size(); let scale_factor = window.scale_factor(); let composite_target = match opts::get().output_file { @@ -419,7 +393,6 @@ impl IOCompositor { frame_tree_id: FrameTreeId(0), constellation_chan: state.constellation_chan, time_profiler_chan: state.time_profiler_chan, - mem_profiler_chan: state.mem_profiler_chan, last_composite_time: 0, ready_to_save_state: ReadyState::Unknown, scroll_in_progress: false, @@ -461,8 +434,6 @@ impl IOCompositor { warn!("Sending exit message to constellation failed ({}).", e); } - self.mem_profiler_chan.send(mem::ProfilerMsg::UnregisterReporter(reporter_name())); - self.shutdown_state = ShutdownState::ShuttingDown; } @@ -481,7 +452,6 @@ impl IOCompositor { }, Err(_) => {}, } - self.mem_profiler_chan.send(mem::ProfilerMsg::Exit); self.delayed_composition_timer.shutdown(); self.shutdown_state = ShutdownState::FinishedShuttingDown; @@ -636,11 +606,6 @@ impl IOCompositor { self.window.head_parsed(); } - (Msg::CollectMemoryReports(reports_chan), ShutdownState::NotShuttingDown) => { - let reports = vec![]; - reports_chan.send(reports); - } - (Msg::PipelineVisibilityChanged(pipeline_id, visible), ShutdownState::NotShuttingDown) => { self.pipeline_details(pipeline_id).visible = visible; if visible { diff --git a/components/compositing/compositor_thread.rs b/components/compositing/compositor_thread.rs index 4796cd502f2..0c449018891 100644 --- a/components/compositing/compositor_thread.rs +++ b/components/compositing/compositor_thread.rs @@ -105,8 +105,6 @@ pub enum Msg { NewFavicon(Url), /// tag finished parsing HeadParsed, - /// Collect memory reports and send them back to the given mem::ReportsChan. - CollectMemoryReports(mem::ReportsChan), /// A status message to be displayed by the browser chrome. Status(Option), /// Get Window Informations size and position @@ -154,7 +152,6 @@ impl Debug for Msg { Msg::IsReadyToSaveImageReply(..) => write!(f, "IsReadyToSaveImageReply"), Msg::NewFavicon(..) => write!(f, "NewFavicon"), Msg::HeadParsed => write!(f, "HeadParsed"), - Msg::CollectMemoryReports(..) => write!(f, "CollectMemoryReports"), Msg::Status(..) => write!(f, "Status"), Msg::GetClientWindow(..) => write!(f, "GetClientWindow"), Msg::MoveTo(..) => write!(f, "MoveTo"), diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 99b0ac0b0a5..cbf08c58a47 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -1025,6 +1025,8 @@ impl Constellation if self.shutting_down { return; } self.shutting_down = true; + self.mem_profiler_chan.send(mem::ProfilerMsg::Exit); + // TODO: exit before the root frame is initialized? debug!("Removing root frame."); let root_frame_id = self.root_frame_id;