Interface nsIMemoryReporterType

An nsIMemoryReporter reports one or more memory measurements via a callback function which is called once for each measurement.

An nsIMemoryReporter that reports a single measurement is sometimes called a "uni-reporter". One that reports multiple measurements is sometimes called a "multi-reporter".

aboutMemory.js is the most important consumer of memory reports. It places the following constraints on reports.

  • All reports within a single sub-tree must have the same units.

  • There may be an "explicit" tree. If present, it represents non-overlapping regions of memory that have been explicitly allocated with an OS-level allocation (e.g. mmap/VirtualAlloc/vm_allocate) or a heap-level allocation (e.g. malloc/calloc/operator new). Reporters in this tree must have kind HEAP or NONHEAP, units BYTES.

It is preferred, but not required, that report descriptions use complete sentences (i.e. start with a capital letter and end with a period, or similar).

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Run the reporter.

    If |anonymize| is true, the memory reporter should anonymize any privacy-sensitive details in memory report paths, by replacing them with a string such as "". Anonymized memory reports may be sent automatically via crash reports or telemetry.

    The following things are considered privacy-sensitive.

    • Content domains and URLs, and information derived from them.
    • Content data, such as strings.
    • Details about content code, such as filenames, function names or stack traces.
    • Details about or data from the user's system, such as filenames.
    • Running apps.

    In short, anything that could identify parts of the user's browsing history is considered privacy-sensitive.

    The following thing are not considered privacy-sensitive.

    • Chrome domains and URLs.
    • Information about installed extensions.

    Parameters

    • callback: nsIHandleReportCallback
    • data: nsISupports
    • anonymize: boolean

    Returns void

Generated using TypeDoc