Rename lots of profiling-related things.

------------------------------------------------------------------------
BEFORE                              AFTER
------------------------------------------------------------------------
util::memory                        util::mem
- heap_size_of                      - heap_size_of (unchanged)
- SizeOf                            - HeapSizeOf
  - size_of_excluding_self            - heap_size_of_children

prof::mem                           prof::mem
- MemoryProfilerChan                - ProfilerChan
- MemoryReport                      - Report
- MemoryReportsChan                 - ReportsChan
- MemoryReporter                    - Reporter
- MemoryProfilerMsg                 - ProfilerMsg
  - {R,UnR}egisterMemoryReporter      - {R,UnR}egisterReporter
- MemoryProfiler                    - Prof
- ReportsForest                     - ReportsForest (unchanged)
- ReportsTree                       - ReportsTree   (unchanged)
- SystemMemoryReporter              - SystemReporter

prof::time                          prof::time
- TimeProfilerChan                  - ProfilerChan
- TimerMetadata                     - TimerMetadata (unchanged)
- Formatable                        - Formattable [spelling!]
- TimeProfilerMsg                   - ProfilerMsg
- TimeProfilerCategory              - ProfilerCategory
- TimeProfilerBuckets               - ProfilerBuckets
- TimeProfiler                      - Profiler
- TimerMetadataFrameType            - TimerMetadataFrameType (unchanged)
- TimerMetadataReflowType           - TimerMetadataReflowType (unchanged)
- ProfilerMetadata                  - ProfilerMetadata (unchanged)

In a few places both prof::time and prof::mem are used, and so
module-qualification is needed to avoid overlap, e.g. time::Profiler and
mem::Profiler. Likewise with std::mem and prof::mem. This is not a big
deal.
This commit is contained in:
Nicholas Nethercote 2015-03-22 15:20:31 -07:00
parent 7f587f6cb5
commit ce36e574f4
19 changed files with 322 additions and 331 deletions

View file

@ -11,7 +11,7 @@ use dom::node::LayoutData;
use geom::point::Point2D;
use geom::rect::Rect;
use msg::constellation_msg::{PipelineExitType, WindowSizeData};
use profile::mem::{MemoryReporter, MemoryReportsChan};
use profile::mem::{Reporter, ReportsChan};
use script_traits::{ScriptControlChan, OpaqueScriptLayoutChannel, UntrustedNodeAddress};
use std::any::Any;
use std::sync::mpsc::{channel, Receiver, Sender};
@ -47,7 +47,7 @@ pub enum Msg {
/// Requests that the layout task measure its memory usage. The resulting reports are sent back
/// via the supplied channel.
CollectMemoryReports(MemoryReportsChan),
CollectReports(ReportsChan),
/// Requests that the layout task enter a quiescent state in which no more messages are
/// accepted except `ExitMsg`. A response message will be sent on the supplied channel when
@ -66,7 +66,7 @@ pub enum Msg {
///
/// 1) read-only with respect to LayoutTaskData,
/// 2) small,
// 3) and really needs to be fast.
/// 3) and really needs to be fast.
pub trait LayoutRPC {
/// Requests the dimensions of the content box, as in the `getBoundingClientRect()` call.
fn content_box(&self) -> ContentBoxResponse;
@ -133,11 +133,11 @@ impl LayoutChan {
}
}
impl MemoryReporter for LayoutChan {
impl Reporter for LayoutChan {
// Just injects an appropriate event into the layout task's queue.
fn collect_reports(&self, reports_chan: MemoryReportsChan) -> bool {
fn collect_reports(&self, reports_chan: ReportsChan) -> bool {
let LayoutChan(ref c) = *self;
c.send(Msg::CollectMemoryReports(reports_chan)).is_ok()
c.send(Msg::CollectReports(reports_chan)).is_ok()
}
}