nsIMemoryMultiReporter 编辑

xpcom/base/nsIMemoryReporter.idlScriptable Reports multiple memory measurements using a callback function that gets called once for each measurement. 1.0 66 Introduced Gecko 7.0 Inherits from: nsISupports Last changed in Gecko 12.0 (Firefox 12.0 / Thunderbird 12.0 / SeaMonkey 2.9)

If you want to gather multiple measurements in a single operation (such as a single traversal of a large data structure), you can use a multi-reporter to do so. The callback, which must implement the nsIMemoryMultiReporterCallback interface, receives values that match the fields in the nsIMemoryReporter object.

In order for a multi-reporter to gather and generate reports, you need to call collectReports(). This will call the specified callback's nsIMemoryMultiReporterCallback.callback() method once for each report. This will trigger any needed computation work.

Note: This differs from the behavior of nsIMemoryReporter, which lets all fields except amount be accessed without triggering computation.

Attributes

AttributeTypeDescription
explicitNonHeapPRInt64

The sum of all of this multi-reporter's measurements that have a path that starts with "explicit" and are of the kind KIND_NONHEAP.

Note: This is a hack that makes nsIMemoryReporterManager.explicit more efficient. This is important; multi-reporters can special-case this operation so it's much faster than gathering all the reports, filtering out the unneeded ones, and adding up the rest.

Method overview

void collectReports(in nsIMemoryMultiReporterCallback callback, in nsISupports closure);

Methods

collectReports()

void collectReports(
  in nsIMemoryMultiReporterCallback callback,
  in nsISupports closure
);
Parameters
callback
The nsIMemoryMultiReporterCallback to call when collection is complete.
closure
An object containing any additional data your callback might need; this gets passed to the callback. You can specify null if your callback doesn't require any additional data.

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:98 次

字数:4624

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文