diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-07-22 11:44:30 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-07-22 11:44:30 -0600 |
commit | 3f69eadc0d55b2f065d59dae84baeac45a0bdc8e (patch) | |
tree | 8e41256b3248af41a47643a0bed864fac0b7e39e /components/compositing/compositor_task.rs | |
parent | 36d732a60a39140806b4113d58a6b00e6b1931da (diff) | |
parent | 5d93f9d5fa92c9d352df8f94c8302c996b0a71f4 (diff) | |
download | servo-3f69eadc0d55b2f065d59dae84baeac45a0bdc8e.tar.gz servo-3f69eadc0d55b2f065d59dae84baeac45a0bdc8e.zip |
Auto merge of #6640 - mrobinson:memory-profiling-for-compositor, r=nnethercote
Add memory profiling for the compositor task
Currently only the BufferMap is recorded, but a later change will also
measure the memory usage of the compositor tree.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6640)
<!-- Reviewable:end -->
Diffstat (limited to 'components/compositing/compositor_task.rs')
-rw-r--r-- | components/compositing/compositor_task.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/components/compositing/compositor_task.rs b/components/compositing/compositor_task.rs index b9738685f6b..dbf661e212d 100644 --- a/components/compositing/compositor_task.rs +++ b/components/compositing/compositor_task.rs @@ -35,7 +35,7 @@ use util::cursor::Cursor; /// process, and so forth. pub trait CompositorProxy : 'static + Send { /// Sends a message to the compositor. - fn send(&mut self, msg: Msg); + fn send(&self, msg: Msg); /// Clones the compositor proxy. fn clone_compositor_proxy(&self) -> Box<CompositorProxy+'static+Send>; } @@ -62,7 +62,7 @@ impl CompositorReceiver for Receiver<Msg> { } } -pub fn run_script_listener_thread(mut compositor_proxy: Box<CompositorProxy + 'static + Send>, +pub fn run_script_listener_thread(compositor_proxy: Box<CompositorProxy + 'static + Send>, receiver: IpcReceiver<ScriptToCompositorMsg>) { while let Ok(msg) = receiver.recv() { match msg { @@ -197,6 +197,8 @@ pub enum Msg { /// Signal that the paint task ignored the paint requests that carried /// these layer buffers, so that they can be re-added to the surface cache. ReturnUnusedLayerBuffers(Vec<Box<LayerBuffer>>), + /// Collect memory reports and send them back to the given mem::ReportsChan. + CollectMemoryReports(mem::ReportsChan), } impl Debug for Msg { @@ -226,6 +228,7 @@ impl Debug for Msg { Msg::NewFavicon(..) => write!(f, "NewFavicon"), Msg::HeadParsed => write!(f, "HeadParsed"), Msg::ReturnUnusedLayerBuffers(..) => write!(f, "ReturnUnusedLayerBuffers"), + Msg::CollectMemoryReports(..) => write!(f, "CollectMemoryReports"), } } } |