Line data Source code
1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsIMemoryReporter.idl
3 : */
4 :
5 : #ifndef __gen_nsIMemoryReporter_h__
6 : #define __gen_nsIMemoryReporter_h__
7 :
8 :
9 : #ifndef __gen_nsISupports_h__
10 : #include "nsISupports.h"
11 : #endif
12 :
13 : #include "mozilla/Assertions.h"
14 : #include "mozilla/DebugOnly.h"
15 :
16 : /* For IDL files that don't want to include root IDL files. */
17 : #ifndef NS_NO_VTABLE
18 : #define NS_NO_VTABLE
19 : #endif
20 : #include <stdio.h>
21 : class mozIDOMWindowProxy; /* forward declaration */
22 :
23 : class nsIRunnable; /* forward declaration */
24 :
25 : class nsISimpleEnumerator; /* forward declaration */
26 :
27 :
28 : /* starting interface: nsIMemoryReporterCallback */
29 : #define NS_IMEMORYREPORTERCALLBACK_IID_STR "62ef0e1c-dbd6-11e3-aa75-3c970e9f4238"
30 :
31 : #define NS_IMEMORYREPORTERCALLBACK_IID \
32 : {0x62ef0e1c, 0xdbd6, 0x11e3, \
33 : { 0xaa, 0x75, 0x3c, 0x97, 0x0e, 0x9f, 0x42, 0x38 }}
34 :
35 0 : class NS_NO_VTABLE nsIMemoryReporterCallback : public nsISupports {
36 : public:
37 :
38 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMEMORYREPORTERCALLBACK_IID)
39 :
40 : /* void callback (in ACString process, in AUTF8String path, in int32_t kind, in int32_t units, in int64_t amount, in AUTF8String description, in nsISupports data); */
41 : NS_IMETHOD Callback(const nsACString & process, const nsACString & path, int32_t kind, int32_t units, int64_t amount, const nsACString & description, nsISupports *data) = 0;
42 :
43 : };
44 :
45 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIMemoryReporterCallback, NS_IMEMORYREPORTERCALLBACK_IID)
46 :
47 : /* Use this macro when declaring classes that implement this interface. */
48 : #define NS_DECL_NSIMEMORYREPORTERCALLBACK \
49 : NS_IMETHOD Callback(const nsACString & process, const nsACString & path, int32_t kind, int32_t units, int64_t amount, const nsACString & description, nsISupports *data) override;
50 :
51 : /* Use this macro when declaring the members of this interface when the
52 : class doesn't implement the interface. This is useful for forwarding. */
53 : #define NS_DECL_NON_VIRTUAL_NSIMEMORYREPORTERCALLBACK \
54 : nsresult Callback(const nsACString & process, const nsACString & path, int32_t kind, int32_t units, int64_t amount, const nsACString & description, nsISupports *data);
55 :
56 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
57 : #define NS_FORWARD_NSIMEMORYREPORTERCALLBACK(_to) \
58 : NS_IMETHOD Callback(const nsACString & process, const nsACString & path, int32_t kind, int32_t units, int64_t amount, const nsACString & description, nsISupports *data) override { return _to Callback(process, path, kind, units, amount, description, data); }
59 :
60 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
61 : #define NS_FORWARD_SAFE_NSIMEMORYREPORTERCALLBACK(_to) \
62 : NS_IMETHOD Callback(const nsACString & process, const nsACString & path, int32_t kind, int32_t units, int64_t amount, const nsACString & description, nsISupports *data) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Callback(process, path, kind, units, amount, description, data); }
63 :
64 : #if 0
65 : /* Use the code below as a template for the implementation class for this interface. */
66 :
67 : /* Header file */
68 : class nsMemoryReporterCallback : public nsIMemoryReporterCallback
69 : {
70 : public:
71 : NS_DECL_ISUPPORTS
72 : NS_DECL_NSIMEMORYREPORTERCALLBACK
73 :
74 : nsMemoryReporterCallback();
75 :
76 : private:
77 : ~nsMemoryReporterCallback();
78 :
79 : protected:
80 : /* additional members */
81 : };
82 :
83 : /* Implementation file */
84 : NS_IMPL_ISUPPORTS(nsMemoryReporterCallback, nsIMemoryReporterCallback)
85 :
86 : nsMemoryReporterCallback::nsMemoryReporterCallback()
87 : {
88 : /* member initializers and constructor code */
89 : }
90 :
91 : nsMemoryReporterCallback::~nsMemoryReporterCallback()
92 : {
93 : /* destructor code */
94 : }
95 :
96 : /* void callback (in ACString process, in AUTF8String path, in int32_t kind, in int32_t units, in int64_t amount, in AUTF8String description, in nsISupports data); */
97 : NS_IMETHODIMP nsMemoryReporterCallback::Callback(const nsACString & process, const nsACString & path, int32_t kind, int32_t units, int64_t amount, const nsACString & description, nsISupports *data)
98 : {
99 : return NS_ERROR_NOT_IMPLEMENTED;
100 : }
101 :
102 : /* End of implementation class template. */
103 : #endif
104 :
105 :
106 : /* starting interface: nsIMemoryReporter */
107 : #define NS_IMEMORYREPORTER_IID_STR "92a36db1-46bd-4fe6-988e-47db47236d8b"
108 :
109 : #define NS_IMEMORYREPORTER_IID \
110 : {0x92a36db1, 0x46bd, 0x4fe6, \
111 : { 0x98, 0x8e, 0x47, 0xdb, 0x47, 0x23, 0x6d, 0x8b }}
112 :
113 153 : class NS_NO_VTABLE nsIMemoryReporter : public nsISupports {
114 : public:
115 :
116 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMEMORYREPORTER_IID)
117 :
118 : /* void collectReports (in nsIMemoryReporterCallback callback, in nsISupports data, in boolean anonymize); */
119 : NS_IMETHOD CollectReports(nsIMemoryReporterCallback *callback, nsISupports *data, bool anonymize) = 0;
120 :
121 : enum {
122 : KIND_NONHEAP = 0,
123 : KIND_HEAP = 1,
124 : KIND_OTHER = 2,
125 : UNITS_BYTES = 0,
126 : UNITS_COUNT = 1,
127 : UNITS_COUNT_CUMULATIVE = 2,
128 : UNITS_PERCENTAGE = 3
129 : };
130 :
131 : };
132 :
133 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIMemoryReporter, NS_IMEMORYREPORTER_IID)
134 :
135 : /* Use this macro when declaring classes that implement this interface. */
136 : #define NS_DECL_NSIMEMORYREPORTER \
137 : NS_IMETHOD CollectReports(nsIMemoryReporterCallback *callback, nsISupports *data, bool anonymize) override; \
138 :
139 : /* Use this macro when declaring the members of this interface when the
140 : class doesn't implement the interface. This is useful for forwarding. */
141 : #define NS_DECL_NON_VIRTUAL_NSIMEMORYREPORTER \
142 : nsresult CollectReports(nsIMemoryReporterCallback *callback, nsISupports *data, bool anonymize); \
143 :
144 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
145 : #define NS_FORWARD_NSIMEMORYREPORTER(_to) \
146 : NS_IMETHOD CollectReports(nsIMemoryReporterCallback *callback, nsISupports *data, bool anonymize) override { return _to CollectReports(callback, data, anonymize); } \
147 :
148 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
149 : #define NS_FORWARD_SAFE_NSIMEMORYREPORTER(_to) \
150 : NS_IMETHOD CollectReports(nsIMemoryReporterCallback *callback, nsISupports *data, bool anonymize) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CollectReports(callback, data, anonymize); } \
151 :
152 : #if 0
153 : /* Use the code below as a template for the implementation class for this interface. */
154 :
155 : /* Header file */
156 : class nsMemoryReporter : public nsIMemoryReporter
157 : {
158 : public:
159 : NS_DECL_ISUPPORTS
160 : NS_DECL_NSIMEMORYREPORTER
161 :
162 : nsMemoryReporter();
163 :
164 : private:
165 : ~nsMemoryReporter();
166 :
167 : protected:
168 : /* additional members */
169 : };
170 :
171 : /* Implementation file */
172 : NS_IMPL_ISUPPORTS(nsMemoryReporter, nsIMemoryReporter)
173 :
174 : nsMemoryReporter::nsMemoryReporter()
175 : {
176 : /* member initializers and constructor code */
177 : }
178 :
179 : nsMemoryReporter::~nsMemoryReporter()
180 : {
181 : /* destructor code */
182 : }
183 :
184 : /* void collectReports (in nsIMemoryReporterCallback callback, in nsISupports data, in boolean anonymize); */
185 : NS_IMETHODIMP nsMemoryReporter::CollectReports(nsIMemoryReporterCallback *callback, nsISupports *data, bool anonymize)
186 : {
187 : return NS_ERROR_NOT_IMPLEMENTED;
188 : }
189 :
190 : /* End of implementation class template. */
191 : #endif
192 :
193 :
194 : /* starting interface: nsIFinishReportingCallback */
195 : #define NS_IFINISHREPORTINGCALLBACK_IID_STR "548b3909-c04d-4ca6-8466-b8bee3837457"
196 :
197 : #define NS_IFINISHREPORTINGCALLBACK_IID \
198 : {0x548b3909, 0xc04d, 0x4ca6, \
199 : { 0x84, 0x66, 0xb8, 0xbe, 0xe3, 0x83, 0x74, 0x57 }}
200 :
201 0 : class NS_NO_VTABLE nsIFinishReportingCallback : public nsISupports {
202 : public:
203 :
204 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFINISHREPORTINGCALLBACK_IID)
205 :
206 : /* void callback (in nsISupports data); */
207 : NS_IMETHOD Callback(nsISupports *data) = 0;
208 :
209 : };
210 :
211 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIFinishReportingCallback, NS_IFINISHREPORTINGCALLBACK_IID)
212 :
213 : /* Use this macro when declaring classes that implement this interface. */
214 : #define NS_DECL_NSIFINISHREPORTINGCALLBACK \
215 : NS_IMETHOD Callback(nsISupports *data) override;
216 :
217 : /* Use this macro when declaring the members of this interface when the
218 : class doesn't implement the interface. This is useful for forwarding. */
219 : #define NS_DECL_NON_VIRTUAL_NSIFINISHREPORTINGCALLBACK \
220 : nsresult Callback(nsISupports *data);
221 :
222 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
223 : #define NS_FORWARD_NSIFINISHREPORTINGCALLBACK(_to) \
224 : NS_IMETHOD Callback(nsISupports *data) override { return _to Callback(data); }
225 :
226 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
227 : #define NS_FORWARD_SAFE_NSIFINISHREPORTINGCALLBACK(_to) \
228 : NS_IMETHOD Callback(nsISupports *data) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Callback(data); }
229 :
230 : #if 0
231 : /* Use the code below as a template for the implementation class for this interface. */
232 :
233 : /* Header file */
234 : class nsFinishReportingCallback : public nsIFinishReportingCallback
235 : {
236 : public:
237 : NS_DECL_ISUPPORTS
238 : NS_DECL_NSIFINISHREPORTINGCALLBACK
239 :
240 : nsFinishReportingCallback();
241 :
242 : private:
243 : ~nsFinishReportingCallback();
244 :
245 : protected:
246 : /* additional members */
247 : };
248 :
249 : /* Implementation file */
250 : NS_IMPL_ISUPPORTS(nsFinishReportingCallback, nsIFinishReportingCallback)
251 :
252 : nsFinishReportingCallback::nsFinishReportingCallback()
253 : {
254 : /* member initializers and constructor code */
255 : }
256 :
257 : nsFinishReportingCallback::~nsFinishReportingCallback()
258 : {
259 : /* destructor code */
260 : }
261 :
262 : /* void callback (in nsISupports data); */
263 : NS_IMETHODIMP nsFinishReportingCallback::Callback(nsISupports *data)
264 : {
265 : return NS_ERROR_NOT_IMPLEMENTED;
266 : }
267 :
268 : /* End of implementation class template. */
269 : #endif
270 :
271 :
272 : /* starting interface: nsIHeapAllocatedCallback */
273 : #define NS_IHEAPALLOCATEDCALLBACK_IID_STR "1a80cd0f-0d9e-4397-be69-68ad28fe5175"
274 :
275 : #define NS_IHEAPALLOCATEDCALLBACK_IID \
276 : {0x1a80cd0f, 0x0d9e, 0x4397, \
277 : { 0xbe, 0x69, 0x68, 0xad, 0x28, 0xfe, 0x51, 0x75 }}
278 :
279 : class NS_NO_VTABLE nsIHeapAllocatedCallback : public nsISupports {
280 : public:
281 :
282 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHEAPALLOCATEDCALLBACK_IID)
283 :
284 : /* void callback (in int64_t bytesAllocated); */
285 : NS_IMETHOD Callback(int64_t bytesAllocated) = 0;
286 :
287 : };
288 :
289 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIHeapAllocatedCallback, NS_IHEAPALLOCATEDCALLBACK_IID)
290 :
291 : /* Use this macro when declaring classes that implement this interface. */
292 : #define NS_DECL_NSIHEAPALLOCATEDCALLBACK \
293 : NS_IMETHOD Callback(int64_t bytesAllocated) override;
294 :
295 : /* Use this macro when declaring the members of this interface when the
296 : class doesn't implement the interface. This is useful for forwarding. */
297 : #define NS_DECL_NON_VIRTUAL_NSIHEAPALLOCATEDCALLBACK \
298 : nsresult Callback(int64_t bytesAllocated);
299 :
300 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
301 : #define NS_FORWARD_NSIHEAPALLOCATEDCALLBACK(_to) \
302 : NS_IMETHOD Callback(int64_t bytesAllocated) override { return _to Callback(bytesAllocated); }
303 :
304 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
305 : #define NS_FORWARD_SAFE_NSIHEAPALLOCATEDCALLBACK(_to) \
306 : NS_IMETHOD Callback(int64_t bytesAllocated) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Callback(bytesAllocated); }
307 :
308 : #if 0
309 : /* Use the code below as a template for the implementation class for this interface. */
310 :
311 : /* Header file */
312 : class nsHeapAllocatedCallback : public nsIHeapAllocatedCallback
313 : {
314 : public:
315 : NS_DECL_ISUPPORTS
316 : NS_DECL_NSIHEAPALLOCATEDCALLBACK
317 :
318 : nsHeapAllocatedCallback();
319 :
320 : private:
321 : ~nsHeapAllocatedCallback();
322 :
323 : protected:
324 : /* additional members */
325 : };
326 :
327 : /* Implementation file */
328 : NS_IMPL_ISUPPORTS(nsHeapAllocatedCallback, nsIHeapAllocatedCallback)
329 :
330 : nsHeapAllocatedCallback::nsHeapAllocatedCallback()
331 : {
332 : /* member initializers and constructor code */
333 : }
334 :
335 : nsHeapAllocatedCallback::~nsHeapAllocatedCallback()
336 : {
337 : /* destructor code */
338 : }
339 :
340 : /* void callback (in int64_t bytesAllocated); */
341 : NS_IMETHODIMP nsHeapAllocatedCallback::Callback(int64_t bytesAllocated)
342 : {
343 : return NS_ERROR_NOT_IMPLEMENTED;
344 : }
345 :
346 : /* End of implementation class template. */
347 : #endif
348 :
349 :
350 : /* starting interface: nsIMemoryReporterManager */
351 : #define NS_IMEMORYREPORTERMANAGER_IID_STR "2998574d-8993-407a-b1a5-8ad7417653e1"
352 :
353 : #define NS_IMEMORYREPORTERMANAGER_IID \
354 : {0x2998574d, 0x8993, 0x407a, \
355 : { 0xb1, 0xa5, 0x8a, 0xd7, 0x41, 0x76, 0x53, 0xe1 }}
356 :
357 3 : class NS_NO_VTABLE nsIMemoryReporterManager : public nsISupports {
358 : public:
359 :
360 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMEMORYREPORTERMANAGER_IID)
361 :
362 : /* [must_use] void init (); */
363 : MOZ_MUST_USE NS_IMETHOD Init(void) = 0;
364 :
365 : /* void registerStrongReporter (in nsIMemoryReporter reporter); */
366 : NS_IMETHOD RegisterStrongReporter(nsIMemoryReporter *reporter) = 0;
367 :
368 : /* void registerStrongAsyncReporter (in nsIMemoryReporter reporter); */
369 : NS_IMETHOD RegisterStrongAsyncReporter(nsIMemoryReporter *reporter) = 0;
370 :
371 : /* void registerWeakReporter (in nsIMemoryReporter reporter); */
372 : NS_IMETHOD RegisterWeakReporter(nsIMemoryReporter *reporter) = 0;
373 :
374 : /* void registerWeakAsyncReporter (in nsIMemoryReporter reporter); */
375 : NS_IMETHOD RegisterWeakAsyncReporter(nsIMemoryReporter *reporter) = 0;
376 :
377 : /* void unregisterStrongReporter (in nsIMemoryReporter reporter); */
378 : NS_IMETHOD UnregisterStrongReporter(nsIMemoryReporter *reporter) = 0;
379 :
380 : /* void unregisterWeakReporter (in nsIMemoryReporter reporter); */
381 : NS_IMETHOD UnregisterWeakReporter(nsIMemoryReporter *reporter) = 0;
382 :
383 : /* void blockRegistrationAndHideExistingReporters (); */
384 : NS_IMETHOD BlockRegistrationAndHideExistingReporters(void) = 0;
385 :
386 : /* void unblockRegistrationAndRestoreOriginalReporters (); */
387 : NS_IMETHOD UnblockRegistrationAndRestoreOriginalReporters(void) = 0;
388 :
389 : /* void registerStrongReporterEvenIfBlocked (in nsIMemoryReporter aReporter); */
390 : NS_IMETHOD RegisterStrongReporterEvenIfBlocked(nsIMemoryReporter *aReporter) = 0;
391 :
392 : /* void getReports (in nsIMemoryReporterCallback handleReport, in nsISupports handleReportData, in nsIFinishReportingCallback finishReporting, in nsISupports finishReportingData, in boolean anonymize); */
393 : NS_IMETHOD GetReports(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize) = 0;
394 :
395 : /* [noscript] void getReportsExtended (in nsIMemoryReporterCallback handleReport, in nsISupports handleReportData, in nsIFinishReportingCallback finishReporting, in nsISupports finishReportingData, in boolean anonymize, in boolean minimizeMemoryUsage, in AString DMDDumpIdent); */
396 : NS_IMETHOD GetReportsExtended(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize, bool minimizeMemoryUsage, const nsAString & DMDDumpIdent) = 0;
397 :
398 : /* [noscript] void getReportsForThisProcessExtended (in nsIMemoryReporterCallback handleReport, in nsISupports handleReportData, in boolean anonymize, in FILE DMDFile, in nsIFinishReportingCallback finishReporting, in nsISupports finishReportingData); */
399 : NS_IMETHOD GetReportsForThisProcessExtended(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, bool anonymize, FILE *DMDFile, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData) = 0;
400 :
401 : /* [noscript] void endReport (); */
402 : NS_IMETHOD EndReport(void) = 0;
403 :
404 : /* [must_use] readonly attribute int64_t vsize; */
405 : MOZ_MUST_USE NS_IMETHOD GetVsize(int64_t *aVsize) = 0;
406 :
407 : /* [must_use] readonly attribute int64_t vsizeMaxContiguous; */
408 : MOZ_MUST_USE NS_IMETHOD GetVsizeMaxContiguous(int64_t *aVsizeMaxContiguous) = 0;
409 :
410 : /* [must_use] readonly attribute int64_t resident; */
411 : MOZ_MUST_USE NS_IMETHOD GetResident(int64_t *aResident) = 0;
412 :
413 : /* [must_use] readonly attribute int64_t residentFast; */
414 : MOZ_MUST_USE NS_IMETHOD GetResidentFast(int64_t *aResidentFast) = 0;
415 :
416 : /* [must_use] readonly attribute int64_t residentPeak; */
417 : MOZ_MUST_USE NS_IMETHOD GetResidentPeak(int64_t *aResidentPeak) = 0;
418 :
419 : /* [must_use] readonly attribute int64_t residentUnique; */
420 : MOZ_MUST_USE NS_IMETHOD GetResidentUnique(int64_t *aResidentUnique) = 0;
421 :
422 : /* [must_use] readonly attribute int64_t heapAllocated; */
423 : MOZ_MUST_USE NS_IMETHOD GetHeapAllocated(int64_t *aHeapAllocated) = 0;
424 :
425 : /* [must_use] readonly attribute int64_t heapOverheadFraction; */
426 : MOZ_MUST_USE NS_IMETHOD GetHeapOverheadFraction(int64_t *aHeapOverheadFraction) = 0;
427 :
428 : /* [must_use] readonly attribute int64_t JSMainRuntimeGCHeap; */
429 : MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeGCHeap(int64_t *aJSMainRuntimeGCHeap) = 0;
430 :
431 : /* [must_use] readonly attribute int64_t JSMainRuntimeTemporaryPeak; */
432 : MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeTemporaryPeak(int64_t *aJSMainRuntimeTemporaryPeak) = 0;
433 :
434 : /* [must_use] readonly attribute int64_t JSMainRuntimeCompartmentsSystem; */
435 : MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeCompartmentsSystem(int64_t *aJSMainRuntimeCompartmentsSystem) = 0;
436 :
437 : /* [must_use] readonly attribute int64_t JSMainRuntimeCompartmentsUser; */
438 : MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeCompartmentsUser(int64_t *aJSMainRuntimeCompartmentsUser) = 0;
439 :
440 : /* [must_use] readonly attribute int64_t imagesContentUsedUncompressed; */
441 : MOZ_MUST_USE NS_IMETHOD GetImagesContentUsedUncompressed(int64_t *aImagesContentUsedUncompressed) = 0;
442 :
443 : /* [must_use] readonly attribute int64_t storageSQLite; */
444 : MOZ_MUST_USE NS_IMETHOD GetStorageSQLite(int64_t *aStorageSQLite) = 0;
445 :
446 : /* [must_use] readonly attribute int64_t lowMemoryEventsVirtual; */
447 : MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsVirtual(int64_t *aLowMemoryEventsVirtual) = 0;
448 :
449 : /* [must_use] readonly attribute int64_t lowMemoryEventsPhysical; */
450 : MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsPhysical(int64_t *aLowMemoryEventsPhysical) = 0;
451 :
452 : /* [must_use] readonly attribute int64_t ghostWindows; */
453 : MOZ_MUST_USE NS_IMETHOD GetGhostWindows(int64_t *aGhostWindows) = 0;
454 :
455 : /* [must_use] readonly attribute int64_t pageFaultsHard; */
456 : MOZ_MUST_USE NS_IMETHOD GetPageFaultsHard(int64_t *aPageFaultsHard) = 0;
457 :
458 : /* [infallible] readonly attribute boolean hasMozMallocUsableSize; */
459 : NS_IMETHOD GetHasMozMallocUsableSize(bool *aHasMozMallocUsableSize) = 0;
460 0 : inline bool GetHasMozMallocUsableSize()
461 : {
462 : bool result;
463 0 : mozilla::DebugOnly<nsresult> rv = GetHasMozMallocUsableSize(&result);
464 0 : MOZ_ASSERT(NS_SUCCEEDED(rv));
465 0 : return result;
466 : }
467 :
468 : /* [infallible] readonly attribute boolean isDMDEnabled; */
469 : NS_IMETHOD GetIsDMDEnabled(bool *aIsDMDEnabled) = 0;
470 : inline bool GetIsDMDEnabled()
471 : {
472 : bool result;
473 : mozilla::DebugOnly<nsresult> rv = GetIsDMDEnabled(&result);
474 : MOZ_ASSERT(NS_SUCCEEDED(rv));
475 : return result;
476 : }
477 :
478 : /* [infallible] readonly attribute boolean isDMDRunning; */
479 : NS_IMETHOD GetIsDMDRunning(bool *aIsDMDRunning) = 0;
480 : inline bool GetIsDMDRunning()
481 : {
482 : bool result;
483 : mozilla::DebugOnly<nsresult> rv = GetIsDMDRunning(&result);
484 : MOZ_ASSERT(NS_SUCCEEDED(rv));
485 : return result;
486 : }
487 :
488 : /* [must_use] void getHeapAllocatedAsync (in nsIHeapAllocatedCallback callback); */
489 : MOZ_MUST_USE NS_IMETHOD GetHeapAllocatedAsync(nsIHeapAllocatedCallback *callback) = 0;
490 :
491 : /* [must_use] void minimizeMemoryUsage (in nsIRunnable callback); */
492 : MOZ_MUST_USE NS_IMETHOD MinimizeMemoryUsage(nsIRunnable *callback) = 0;
493 :
494 : /* [must_use] void sizeOfTab (in mozIDOMWindowProxy window, out int64_t jsObjectsSize, out int64_t jsStringsSize, out int64_t jsOtherSize, out int64_t domSize, out int64_t styleSize, out int64_t otherSize, out int64_t totalSize, out double jsMilliseconds, out double nonJSMilliseconds); */
495 : MOZ_MUST_USE NS_IMETHOD SizeOfTab(mozIDOMWindowProxy *window, int64_t *jsObjectsSize, int64_t *jsStringsSize, int64_t *jsOtherSize, int64_t *domSize, int64_t *styleSize, int64_t *otherSize, int64_t *totalSize, double *jsMilliseconds, double *nonJSMilliseconds) = 0;
496 :
497 : };
498 :
499 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIMemoryReporterManager, NS_IMEMORYREPORTERMANAGER_IID)
500 :
501 : /* Use this macro when declaring classes that implement this interface. */
502 : #define NS_DECL_NSIMEMORYREPORTERMANAGER \
503 : MOZ_MUST_USE NS_IMETHOD Init(void) override; \
504 : NS_IMETHOD RegisterStrongReporter(nsIMemoryReporter *reporter) override; \
505 : NS_IMETHOD RegisterStrongAsyncReporter(nsIMemoryReporter *reporter) override; \
506 : NS_IMETHOD RegisterWeakReporter(nsIMemoryReporter *reporter) override; \
507 : NS_IMETHOD RegisterWeakAsyncReporter(nsIMemoryReporter *reporter) override; \
508 : NS_IMETHOD UnregisterStrongReporter(nsIMemoryReporter *reporter) override; \
509 : NS_IMETHOD UnregisterWeakReporter(nsIMemoryReporter *reporter) override; \
510 : NS_IMETHOD BlockRegistrationAndHideExistingReporters(void) override; \
511 : NS_IMETHOD UnblockRegistrationAndRestoreOriginalReporters(void) override; \
512 : NS_IMETHOD RegisterStrongReporterEvenIfBlocked(nsIMemoryReporter *aReporter) override; \
513 : NS_IMETHOD GetReports(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize) override; \
514 : NS_IMETHOD GetReportsExtended(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize, bool minimizeMemoryUsage, const nsAString & DMDDumpIdent) override; \
515 : NS_IMETHOD GetReportsForThisProcessExtended(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, bool anonymize, FILE *DMDFile, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData) override; \
516 : NS_IMETHOD EndReport(void) override; \
517 : MOZ_MUST_USE NS_IMETHOD GetVsize(int64_t *aVsize) override; \
518 : MOZ_MUST_USE NS_IMETHOD GetVsizeMaxContiguous(int64_t *aVsizeMaxContiguous) override; \
519 : MOZ_MUST_USE NS_IMETHOD GetResident(int64_t *aResident) override; \
520 : MOZ_MUST_USE NS_IMETHOD GetResidentFast(int64_t *aResidentFast) override; \
521 : MOZ_MUST_USE NS_IMETHOD GetResidentPeak(int64_t *aResidentPeak) override; \
522 : MOZ_MUST_USE NS_IMETHOD GetResidentUnique(int64_t *aResidentUnique) override; \
523 : MOZ_MUST_USE NS_IMETHOD GetHeapAllocated(int64_t *aHeapAllocated) override; \
524 : MOZ_MUST_USE NS_IMETHOD GetHeapOverheadFraction(int64_t *aHeapOverheadFraction) override; \
525 : MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeGCHeap(int64_t *aJSMainRuntimeGCHeap) override; \
526 : MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeTemporaryPeak(int64_t *aJSMainRuntimeTemporaryPeak) override; \
527 : MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeCompartmentsSystem(int64_t *aJSMainRuntimeCompartmentsSystem) override; \
528 : MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeCompartmentsUser(int64_t *aJSMainRuntimeCompartmentsUser) override; \
529 : MOZ_MUST_USE NS_IMETHOD GetImagesContentUsedUncompressed(int64_t *aImagesContentUsedUncompressed) override; \
530 : MOZ_MUST_USE NS_IMETHOD GetStorageSQLite(int64_t *aStorageSQLite) override; \
531 : MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsVirtual(int64_t *aLowMemoryEventsVirtual) override; \
532 : MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsPhysical(int64_t *aLowMemoryEventsPhysical) override; \
533 : MOZ_MUST_USE NS_IMETHOD GetGhostWindows(int64_t *aGhostWindows) override; \
534 : MOZ_MUST_USE NS_IMETHOD GetPageFaultsHard(int64_t *aPageFaultsHard) override; \
535 : using nsIMemoryReporterManager::GetHasMozMallocUsableSize; \
536 : NS_IMETHOD GetHasMozMallocUsableSize(bool *aHasMozMallocUsableSize) override; \
537 : using nsIMemoryReporterManager::GetIsDMDEnabled; \
538 : NS_IMETHOD GetIsDMDEnabled(bool *aIsDMDEnabled) override; \
539 : using nsIMemoryReporterManager::GetIsDMDRunning; \
540 : NS_IMETHOD GetIsDMDRunning(bool *aIsDMDRunning) override; \
541 : MOZ_MUST_USE NS_IMETHOD GetHeapAllocatedAsync(nsIHeapAllocatedCallback *callback) override; \
542 : MOZ_MUST_USE NS_IMETHOD MinimizeMemoryUsage(nsIRunnable *callback) override; \
543 : MOZ_MUST_USE NS_IMETHOD SizeOfTab(mozIDOMWindowProxy *window, int64_t *jsObjectsSize, int64_t *jsStringsSize, int64_t *jsOtherSize, int64_t *domSize, int64_t *styleSize, int64_t *otherSize, int64_t *totalSize, double *jsMilliseconds, double *nonJSMilliseconds) override;
544 :
545 : /* Use this macro when declaring the members of this interface when the
546 : class doesn't implement the interface. This is useful for forwarding. */
547 : #define NS_DECL_NON_VIRTUAL_NSIMEMORYREPORTERMANAGER \
548 : MOZ_MUST_USE nsresult Init(void); \
549 : nsresult RegisterStrongReporter(nsIMemoryReporter *reporter); \
550 : nsresult RegisterStrongAsyncReporter(nsIMemoryReporter *reporter); \
551 : nsresult RegisterWeakReporter(nsIMemoryReporter *reporter); \
552 : nsresult RegisterWeakAsyncReporter(nsIMemoryReporter *reporter); \
553 : nsresult UnregisterStrongReporter(nsIMemoryReporter *reporter); \
554 : nsresult UnregisterWeakReporter(nsIMemoryReporter *reporter); \
555 : nsresult BlockRegistrationAndHideExistingReporters(void); \
556 : nsresult UnblockRegistrationAndRestoreOriginalReporters(void); \
557 : nsresult RegisterStrongReporterEvenIfBlocked(nsIMemoryReporter *aReporter); \
558 : nsresult GetReports(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize); \
559 : nsresult GetReportsExtended(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize, bool minimizeMemoryUsage, const nsAString & DMDDumpIdent); \
560 : nsresult GetReportsForThisProcessExtended(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, bool anonymize, FILE *DMDFile, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData); \
561 : nsresult EndReport(void); \
562 : MOZ_MUST_USE nsresult GetVsize(int64_t *aVsize); \
563 : MOZ_MUST_USE nsresult GetVsizeMaxContiguous(int64_t *aVsizeMaxContiguous); \
564 : MOZ_MUST_USE nsresult GetResident(int64_t *aResident); \
565 : MOZ_MUST_USE nsresult GetResidentFast(int64_t *aResidentFast); \
566 : MOZ_MUST_USE nsresult GetResidentPeak(int64_t *aResidentPeak); \
567 : MOZ_MUST_USE nsresult GetResidentUnique(int64_t *aResidentUnique); \
568 : MOZ_MUST_USE nsresult GetHeapAllocated(int64_t *aHeapAllocated); \
569 : MOZ_MUST_USE nsresult GetHeapOverheadFraction(int64_t *aHeapOverheadFraction); \
570 : MOZ_MUST_USE nsresult GetJSMainRuntimeGCHeap(int64_t *aJSMainRuntimeGCHeap); \
571 : MOZ_MUST_USE nsresult GetJSMainRuntimeTemporaryPeak(int64_t *aJSMainRuntimeTemporaryPeak); \
572 : MOZ_MUST_USE nsresult GetJSMainRuntimeCompartmentsSystem(int64_t *aJSMainRuntimeCompartmentsSystem); \
573 : MOZ_MUST_USE nsresult GetJSMainRuntimeCompartmentsUser(int64_t *aJSMainRuntimeCompartmentsUser); \
574 : MOZ_MUST_USE nsresult GetImagesContentUsedUncompressed(int64_t *aImagesContentUsedUncompressed); \
575 : MOZ_MUST_USE nsresult GetStorageSQLite(int64_t *aStorageSQLite); \
576 : MOZ_MUST_USE nsresult GetLowMemoryEventsVirtual(int64_t *aLowMemoryEventsVirtual); \
577 : MOZ_MUST_USE nsresult GetLowMemoryEventsPhysical(int64_t *aLowMemoryEventsPhysical); \
578 : MOZ_MUST_USE nsresult GetGhostWindows(int64_t *aGhostWindows); \
579 : MOZ_MUST_USE nsresult GetPageFaultsHard(int64_t *aPageFaultsHard); \
580 : using nsIMemoryReporterManager::GetHasMozMallocUsableSize; \
581 : nsresult GetHasMozMallocUsableSize(bool *aHasMozMallocUsableSize); \
582 : using nsIMemoryReporterManager::GetIsDMDEnabled; \
583 : nsresult GetIsDMDEnabled(bool *aIsDMDEnabled); \
584 : using nsIMemoryReporterManager::GetIsDMDRunning; \
585 : nsresult GetIsDMDRunning(bool *aIsDMDRunning); \
586 : MOZ_MUST_USE nsresult GetHeapAllocatedAsync(nsIHeapAllocatedCallback *callback); \
587 : MOZ_MUST_USE nsresult MinimizeMemoryUsage(nsIRunnable *callback); \
588 : MOZ_MUST_USE nsresult SizeOfTab(mozIDOMWindowProxy *window, int64_t *jsObjectsSize, int64_t *jsStringsSize, int64_t *jsOtherSize, int64_t *domSize, int64_t *styleSize, int64_t *otherSize, int64_t *totalSize, double *jsMilliseconds, double *nonJSMilliseconds);
589 :
590 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
591 : #define NS_FORWARD_NSIMEMORYREPORTERMANAGER(_to) \
592 : MOZ_MUST_USE NS_IMETHOD Init(void) override { return _to Init(); } \
593 : NS_IMETHOD RegisterStrongReporter(nsIMemoryReporter *reporter) override { return _to RegisterStrongReporter(reporter); } \
594 : NS_IMETHOD RegisterStrongAsyncReporter(nsIMemoryReporter *reporter) override { return _to RegisterStrongAsyncReporter(reporter); } \
595 : NS_IMETHOD RegisterWeakReporter(nsIMemoryReporter *reporter) override { return _to RegisterWeakReporter(reporter); } \
596 : NS_IMETHOD RegisterWeakAsyncReporter(nsIMemoryReporter *reporter) override { return _to RegisterWeakAsyncReporter(reporter); } \
597 : NS_IMETHOD UnregisterStrongReporter(nsIMemoryReporter *reporter) override { return _to UnregisterStrongReporter(reporter); } \
598 : NS_IMETHOD UnregisterWeakReporter(nsIMemoryReporter *reporter) override { return _to UnregisterWeakReporter(reporter); } \
599 : NS_IMETHOD BlockRegistrationAndHideExistingReporters(void) override { return _to BlockRegistrationAndHideExistingReporters(); } \
600 : NS_IMETHOD UnblockRegistrationAndRestoreOriginalReporters(void) override { return _to UnblockRegistrationAndRestoreOriginalReporters(); } \
601 : NS_IMETHOD RegisterStrongReporterEvenIfBlocked(nsIMemoryReporter *aReporter) override { return _to RegisterStrongReporterEvenIfBlocked(aReporter); } \
602 : NS_IMETHOD GetReports(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize) override { return _to GetReports(handleReport, handleReportData, finishReporting, finishReportingData, anonymize); } \
603 : NS_IMETHOD GetReportsExtended(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize, bool minimizeMemoryUsage, const nsAString & DMDDumpIdent) override { return _to GetReportsExtended(handleReport, handleReportData, finishReporting, finishReportingData, anonymize, minimizeMemoryUsage, DMDDumpIdent); } \
604 : NS_IMETHOD GetReportsForThisProcessExtended(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, bool anonymize, FILE *DMDFile, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData) override { return _to GetReportsForThisProcessExtended(handleReport, handleReportData, anonymize, DMDFile, finishReporting, finishReportingData); } \
605 : NS_IMETHOD EndReport(void) override { return _to EndReport(); } \
606 : MOZ_MUST_USE NS_IMETHOD GetVsize(int64_t *aVsize) override { return _to GetVsize(aVsize); } \
607 : MOZ_MUST_USE NS_IMETHOD GetVsizeMaxContiguous(int64_t *aVsizeMaxContiguous) override { return _to GetVsizeMaxContiguous(aVsizeMaxContiguous); } \
608 : MOZ_MUST_USE NS_IMETHOD GetResident(int64_t *aResident) override { return _to GetResident(aResident); } \
609 : MOZ_MUST_USE NS_IMETHOD GetResidentFast(int64_t *aResidentFast) override { return _to GetResidentFast(aResidentFast); } \
610 : MOZ_MUST_USE NS_IMETHOD GetResidentPeak(int64_t *aResidentPeak) override { return _to GetResidentPeak(aResidentPeak); } \
611 : MOZ_MUST_USE NS_IMETHOD GetResidentUnique(int64_t *aResidentUnique) override { return _to GetResidentUnique(aResidentUnique); } \
612 : MOZ_MUST_USE NS_IMETHOD GetHeapAllocated(int64_t *aHeapAllocated) override { return _to GetHeapAllocated(aHeapAllocated); } \
613 : MOZ_MUST_USE NS_IMETHOD GetHeapOverheadFraction(int64_t *aHeapOverheadFraction) override { return _to GetHeapOverheadFraction(aHeapOverheadFraction); } \
614 : MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeGCHeap(int64_t *aJSMainRuntimeGCHeap) override { return _to GetJSMainRuntimeGCHeap(aJSMainRuntimeGCHeap); } \
615 : MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeTemporaryPeak(int64_t *aJSMainRuntimeTemporaryPeak) override { return _to GetJSMainRuntimeTemporaryPeak(aJSMainRuntimeTemporaryPeak); } \
616 : MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeCompartmentsSystem(int64_t *aJSMainRuntimeCompartmentsSystem) override { return _to GetJSMainRuntimeCompartmentsSystem(aJSMainRuntimeCompartmentsSystem); } \
617 : MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeCompartmentsUser(int64_t *aJSMainRuntimeCompartmentsUser) override { return _to GetJSMainRuntimeCompartmentsUser(aJSMainRuntimeCompartmentsUser); } \
618 : MOZ_MUST_USE NS_IMETHOD GetImagesContentUsedUncompressed(int64_t *aImagesContentUsedUncompressed) override { return _to GetImagesContentUsedUncompressed(aImagesContentUsedUncompressed); } \
619 : MOZ_MUST_USE NS_IMETHOD GetStorageSQLite(int64_t *aStorageSQLite) override { return _to GetStorageSQLite(aStorageSQLite); } \
620 : MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsVirtual(int64_t *aLowMemoryEventsVirtual) override { return _to GetLowMemoryEventsVirtual(aLowMemoryEventsVirtual); } \
621 : MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsPhysical(int64_t *aLowMemoryEventsPhysical) override { return _to GetLowMemoryEventsPhysical(aLowMemoryEventsPhysical); } \
622 : MOZ_MUST_USE NS_IMETHOD GetGhostWindows(int64_t *aGhostWindows) override { return _to GetGhostWindows(aGhostWindows); } \
623 : MOZ_MUST_USE NS_IMETHOD GetPageFaultsHard(int64_t *aPageFaultsHard) override { return _to GetPageFaultsHard(aPageFaultsHard); } \
624 : using nsIMemoryReporterManager::GetHasMozMallocUsableSize; \
625 : NS_IMETHOD GetHasMozMallocUsableSize(bool *aHasMozMallocUsableSize) override { return _to GetHasMozMallocUsableSize(aHasMozMallocUsableSize); } \
626 : using nsIMemoryReporterManager::GetIsDMDEnabled; \
627 : NS_IMETHOD GetIsDMDEnabled(bool *aIsDMDEnabled) override { return _to GetIsDMDEnabled(aIsDMDEnabled); } \
628 : using nsIMemoryReporterManager::GetIsDMDRunning; \
629 : NS_IMETHOD GetIsDMDRunning(bool *aIsDMDRunning) override { return _to GetIsDMDRunning(aIsDMDRunning); } \
630 : MOZ_MUST_USE NS_IMETHOD GetHeapAllocatedAsync(nsIHeapAllocatedCallback *callback) override { return _to GetHeapAllocatedAsync(callback); } \
631 : MOZ_MUST_USE NS_IMETHOD MinimizeMemoryUsage(nsIRunnable *callback) override { return _to MinimizeMemoryUsage(callback); } \
632 : MOZ_MUST_USE NS_IMETHOD SizeOfTab(mozIDOMWindowProxy *window, int64_t *jsObjectsSize, int64_t *jsStringsSize, int64_t *jsOtherSize, int64_t *domSize, int64_t *styleSize, int64_t *otherSize, int64_t *totalSize, double *jsMilliseconds, double *nonJSMilliseconds) override { return _to SizeOfTab(window, jsObjectsSize, jsStringsSize, jsOtherSize, domSize, styleSize, otherSize, totalSize, jsMilliseconds, nonJSMilliseconds); }
633 :
634 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
635 : #define NS_FORWARD_SAFE_NSIMEMORYREPORTERMANAGER(_to) \
636 : MOZ_MUST_USE NS_IMETHOD Init(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(); } \
637 : NS_IMETHOD RegisterStrongReporter(nsIMemoryReporter *reporter) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterStrongReporter(reporter); } \
638 : NS_IMETHOD RegisterStrongAsyncReporter(nsIMemoryReporter *reporter) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterStrongAsyncReporter(reporter); } \
639 : NS_IMETHOD RegisterWeakReporter(nsIMemoryReporter *reporter) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterWeakReporter(reporter); } \
640 : NS_IMETHOD RegisterWeakAsyncReporter(nsIMemoryReporter *reporter) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterWeakAsyncReporter(reporter); } \
641 : NS_IMETHOD UnregisterStrongReporter(nsIMemoryReporter *reporter) override { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterStrongReporter(reporter); } \
642 : NS_IMETHOD UnregisterWeakReporter(nsIMemoryReporter *reporter) override { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterWeakReporter(reporter); } \
643 : NS_IMETHOD BlockRegistrationAndHideExistingReporters(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->BlockRegistrationAndHideExistingReporters(); } \
644 : NS_IMETHOD UnblockRegistrationAndRestoreOriginalReporters(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->UnblockRegistrationAndRestoreOriginalReporters(); } \
645 : NS_IMETHOD RegisterStrongReporterEvenIfBlocked(nsIMemoryReporter *aReporter) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterStrongReporterEvenIfBlocked(aReporter); } \
646 : NS_IMETHOD GetReports(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetReports(handleReport, handleReportData, finishReporting, finishReportingData, anonymize); } \
647 : NS_IMETHOD GetReportsExtended(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize, bool minimizeMemoryUsage, const nsAString & DMDDumpIdent) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetReportsExtended(handleReport, handleReportData, finishReporting, finishReportingData, anonymize, minimizeMemoryUsage, DMDDumpIdent); } \
648 : NS_IMETHOD GetReportsForThisProcessExtended(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, bool anonymize, FILE *DMDFile, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetReportsForThisProcessExtended(handleReport, handleReportData, anonymize, DMDFile, finishReporting, finishReportingData); } \
649 : NS_IMETHOD EndReport(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->EndReport(); } \
650 : MOZ_MUST_USE NS_IMETHOD GetVsize(int64_t *aVsize) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetVsize(aVsize); } \
651 : MOZ_MUST_USE NS_IMETHOD GetVsizeMaxContiguous(int64_t *aVsizeMaxContiguous) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetVsizeMaxContiguous(aVsizeMaxContiguous); } \
652 : MOZ_MUST_USE NS_IMETHOD GetResident(int64_t *aResident) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResident(aResident); } \
653 : MOZ_MUST_USE NS_IMETHOD GetResidentFast(int64_t *aResidentFast) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResidentFast(aResidentFast); } \
654 : MOZ_MUST_USE NS_IMETHOD GetResidentPeak(int64_t *aResidentPeak) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResidentPeak(aResidentPeak); } \
655 : MOZ_MUST_USE NS_IMETHOD GetResidentUnique(int64_t *aResidentUnique) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResidentUnique(aResidentUnique); } \
656 : MOZ_MUST_USE NS_IMETHOD GetHeapAllocated(int64_t *aHeapAllocated) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHeapAllocated(aHeapAllocated); } \
657 : MOZ_MUST_USE NS_IMETHOD GetHeapOverheadFraction(int64_t *aHeapOverheadFraction) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHeapOverheadFraction(aHeapOverheadFraction); } \
658 : MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeGCHeap(int64_t *aJSMainRuntimeGCHeap) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetJSMainRuntimeGCHeap(aJSMainRuntimeGCHeap); } \
659 : MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeTemporaryPeak(int64_t *aJSMainRuntimeTemporaryPeak) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetJSMainRuntimeTemporaryPeak(aJSMainRuntimeTemporaryPeak); } \
660 : MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeCompartmentsSystem(int64_t *aJSMainRuntimeCompartmentsSystem) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetJSMainRuntimeCompartmentsSystem(aJSMainRuntimeCompartmentsSystem); } \
661 : MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeCompartmentsUser(int64_t *aJSMainRuntimeCompartmentsUser) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetJSMainRuntimeCompartmentsUser(aJSMainRuntimeCompartmentsUser); } \
662 : MOZ_MUST_USE NS_IMETHOD GetImagesContentUsedUncompressed(int64_t *aImagesContentUsedUncompressed) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetImagesContentUsedUncompressed(aImagesContentUsedUncompressed); } \
663 : MOZ_MUST_USE NS_IMETHOD GetStorageSQLite(int64_t *aStorageSQLite) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStorageSQLite(aStorageSQLite); } \
664 : MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsVirtual(int64_t *aLowMemoryEventsVirtual) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLowMemoryEventsVirtual(aLowMemoryEventsVirtual); } \
665 : MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsPhysical(int64_t *aLowMemoryEventsPhysical) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLowMemoryEventsPhysical(aLowMemoryEventsPhysical); } \
666 : MOZ_MUST_USE NS_IMETHOD GetGhostWindows(int64_t *aGhostWindows) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetGhostWindows(aGhostWindows); } \
667 : MOZ_MUST_USE NS_IMETHOD GetPageFaultsHard(int64_t *aPageFaultsHard) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPageFaultsHard(aPageFaultsHard); } \
668 : NS_IMETHOD GetHasMozMallocUsableSize(bool *aHasMozMallocUsableSize) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHasMozMallocUsableSize(aHasMozMallocUsableSize); } \
669 : NS_IMETHOD GetIsDMDEnabled(bool *aIsDMDEnabled) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsDMDEnabled(aIsDMDEnabled); } \
670 : NS_IMETHOD GetIsDMDRunning(bool *aIsDMDRunning) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsDMDRunning(aIsDMDRunning); } \
671 : MOZ_MUST_USE NS_IMETHOD GetHeapAllocatedAsync(nsIHeapAllocatedCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHeapAllocatedAsync(callback); } \
672 : MOZ_MUST_USE NS_IMETHOD MinimizeMemoryUsage(nsIRunnable *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->MinimizeMemoryUsage(callback); } \
673 : MOZ_MUST_USE NS_IMETHOD SizeOfTab(mozIDOMWindowProxy *window, int64_t *jsObjectsSize, int64_t *jsStringsSize, int64_t *jsOtherSize, int64_t *domSize, int64_t *styleSize, int64_t *otherSize, int64_t *totalSize, double *jsMilliseconds, double *nonJSMilliseconds) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SizeOfTab(window, jsObjectsSize, jsStringsSize, jsOtherSize, domSize, styleSize, otherSize, totalSize, jsMilliseconds, nonJSMilliseconds); }
674 :
675 : #if 0
676 : /* Use the code below as a template for the implementation class for this interface. */
677 :
678 : /* Header file */
679 : class nsMemoryReporterManager : public nsIMemoryReporterManager
680 : {
681 : public:
682 : NS_DECL_ISUPPORTS
683 : NS_DECL_NSIMEMORYREPORTERMANAGER
684 :
685 : nsMemoryReporterManager();
686 :
687 : private:
688 : ~nsMemoryReporterManager();
689 :
690 : protected:
691 : /* additional members */
692 : };
693 :
694 : /* Implementation file */
695 : NS_IMPL_ISUPPORTS(nsMemoryReporterManager, nsIMemoryReporterManager)
696 :
697 : nsMemoryReporterManager::nsMemoryReporterManager()
698 : {
699 : /* member initializers and constructor code */
700 : }
701 :
702 : nsMemoryReporterManager::~nsMemoryReporterManager()
703 : {
704 : /* destructor code */
705 : }
706 :
707 : /* [must_use] void init (); */
708 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::Init()
709 : {
710 : return NS_ERROR_NOT_IMPLEMENTED;
711 : }
712 :
713 : /* void registerStrongReporter (in nsIMemoryReporter reporter); */
714 : NS_IMETHODIMP nsMemoryReporterManager::RegisterStrongReporter(nsIMemoryReporter *reporter)
715 : {
716 : return NS_ERROR_NOT_IMPLEMENTED;
717 : }
718 :
719 : /* void registerStrongAsyncReporter (in nsIMemoryReporter reporter); */
720 : NS_IMETHODIMP nsMemoryReporterManager::RegisterStrongAsyncReporter(nsIMemoryReporter *reporter)
721 : {
722 : return NS_ERROR_NOT_IMPLEMENTED;
723 : }
724 :
725 : /* void registerWeakReporter (in nsIMemoryReporter reporter); */
726 : NS_IMETHODIMP nsMemoryReporterManager::RegisterWeakReporter(nsIMemoryReporter *reporter)
727 : {
728 : return NS_ERROR_NOT_IMPLEMENTED;
729 : }
730 :
731 : /* void registerWeakAsyncReporter (in nsIMemoryReporter reporter); */
732 : NS_IMETHODIMP nsMemoryReporterManager::RegisterWeakAsyncReporter(nsIMemoryReporter *reporter)
733 : {
734 : return NS_ERROR_NOT_IMPLEMENTED;
735 : }
736 :
737 : /* void unregisterStrongReporter (in nsIMemoryReporter reporter); */
738 : NS_IMETHODIMP nsMemoryReporterManager::UnregisterStrongReporter(nsIMemoryReporter *reporter)
739 : {
740 : return NS_ERROR_NOT_IMPLEMENTED;
741 : }
742 :
743 : /* void unregisterWeakReporter (in nsIMemoryReporter reporter); */
744 : NS_IMETHODIMP nsMemoryReporterManager::UnregisterWeakReporter(nsIMemoryReporter *reporter)
745 : {
746 : return NS_ERROR_NOT_IMPLEMENTED;
747 : }
748 :
749 : /* void blockRegistrationAndHideExistingReporters (); */
750 : NS_IMETHODIMP nsMemoryReporterManager::BlockRegistrationAndHideExistingReporters()
751 : {
752 : return NS_ERROR_NOT_IMPLEMENTED;
753 : }
754 :
755 : /* void unblockRegistrationAndRestoreOriginalReporters (); */
756 : NS_IMETHODIMP nsMemoryReporterManager::UnblockRegistrationAndRestoreOriginalReporters()
757 : {
758 : return NS_ERROR_NOT_IMPLEMENTED;
759 : }
760 :
761 : /* void registerStrongReporterEvenIfBlocked (in nsIMemoryReporter aReporter); */
762 : NS_IMETHODIMP nsMemoryReporterManager::RegisterStrongReporterEvenIfBlocked(nsIMemoryReporter *aReporter)
763 : {
764 : return NS_ERROR_NOT_IMPLEMENTED;
765 : }
766 :
767 : /* void getReports (in nsIMemoryReporterCallback handleReport, in nsISupports handleReportData, in nsIFinishReportingCallback finishReporting, in nsISupports finishReportingData, in boolean anonymize); */
768 : NS_IMETHODIMP nsMemoryReporterManager::GetReports(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize)
769 : {
770 : return NS_ERROR_NOT_IMPLEMENTED;
771 : }
772 :
773 : /* [noscript] void getReportsExtended (in nsIMemoryReporterCallback handleReport, in nsISupports handleReportData, in nsIFinishReportingCallback finishReporting, in nsISupports finishReportingData, in boolean anonymize, in boolean minimizeMemoryUsage, in AString DMDDumpIdent); */
774 : NS_IMETHODIMP nsMemoryReporterManager::GetReportsExtended(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize, bool minimizeMemoryUsage, const nsAString & DMDDumpIdent)
775 : {
776 : return NS_ERROR_NOT_IMPLEMENTED;
777 : }
778 :
779 : /* [noscript] void getReportsForThisProcessExtended (in nsIMemoryReporterCallback handleReport, in nsISupports handleReportData, in boolean anonymize, in FILE DMDFile, in nsIFinishReportingCallback finishReporting, in nsISupports finishReportingData); */
780 : NS_IMETHODIMP nsMemoryReporterManager::GetReportsForThisProcessExtended(nsIMemoryReporterCallback *handleReport, nsISupports *handleReportData, bool anonymize, FILE *DMDFile, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData)
781 : {
782 : return NS_ERROR_NOT_IMPLEMENTED;
783 : }
784 :
785 : /* [noscript] void endReport (); */
786 : NS_IMETHODIMP nsMemoryReporterManager::EndReport()
787 : {
788 : return NS_ERROR_NOT_IMPLEMENTED;
789 : }
790 :
791 : /* [must_use] readonly attribute int64_t vsize; */
792 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetVsize(int64_t *aVsize)
793 : {
794 : return NS_ERROR_NOT_IMPLEMENTED;
795 : }
796 :
797 : /* [must_use] readonly attribute int64_t vsizeMaxContiguous; */
798 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetVsizeMaxContiguous(int64_t *aVsizeMaxContiguous)
799 : {
800 : return NS_ERROR_NOT_IMPLEMENTED;
801 : }
802 :
803 : /* [must_use] readonly attribute int64_t resident; */
804 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetResident(int64_t *aResident)
805 : {
806 : return NS_ERROR_NOT_IMPLEMENTED;
807 : }
808 :
809 : /* [must_use] readonly attribute int64_t residentFast; */
810 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetResidentFast(int64_t *aResidentFast)
811 : {
812 : return NS_ERROR_NOT_IMPLEMENTED;
813 : }
814 :
815 : /* [must_use] readonly attribute int64_t residentPeak; */
816 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetResidentPeak(int64_t *aResidentPeak)
817 : {
818 : return NS_ERROR_NOT_IMPLEMENTED;
819 : }
820 :
821 : /* [must_use] readonly attribute int64_t residentUnique; */
822 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetResidentUnique(int64_t *aResidentUnique)
823 : {
824 : return NS_ERROR_NOT_IMPLEMENTED;
825 : }
826 :
827 : /* [must_use] readonly attribute int64_t heapAllocated; */
828 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetHeapAllocated(int64_t *aHeapAllocated)
829 : {
830 : return NS_ERROR_NOT_IMPLEMENTED;
831 : }
832 :
833 : /* [must_use] readonly attribute int64_t heapOverheadFraction; */
834 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetHeapOverheadFraction(int64_t *aHeapOverheadFraction)
835 : {
836 : return NS_ERROR_NOT_IMPLEMENTED;
837 : }
838 :
839 : /* [must_use] readonly attribute int64_t JSMainRuntimeGCHeap; */
840 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetJSMainRuntimeGCHeap(int64_t *aJSMainRuntimeGCHeap)
841 : {
842 : return NS_ERROR_NOT_IMPLEMENTED;
843 : }
844 :
845 : /* [must_use] readonly attribute int64_t JSMainRuntimeTemporaryPeak; */
846 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetJSMainRuntimeTemporaryPeak(int64_t *aJSMainRuntimeTemporaryPeak)
847 : {
848 : return NS_ERROR_NOT_IMPLEMENTED;
849 : }
850 :
851 : /* [must_use] readonly attribute int64_t JSMainRuntimeCompartmentsSystem; */
852 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetJSMainRuntimeCompartmentsSystem(int64_t *aJSMainRuntimeCompartmentsSystem)
853 : {
854 : return NS_ERROR_NOT_IMPLEMENTED;
855 : }
856 :
857 : /* [must_use] readonly attribute int64_t JSMainRuntimeCompartmentsUser; */
858 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetJSMainRuntimeCompartmentsUser(int64_t *aJSMainRuntimeCompartmentsUser)
859 : {
860 : return NS_ERROR_NOT_IMPLEMENTED;
861 : }
862 :
863 : /* [must_use] readonly attribute int64_t imagesContentUsedUncompressed; */
864 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetImagesContentUsedUncompressed(int64_t *aImagesContentUsedUncompressed)
865 : {
866 : return NS_ERROR_NOT_IMPLEMENTED;
867 : }
868 :
869 : /* [must_use] readonly attribute int64_t storageSQLite; */
870 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetStorageSQLite(int64_t *aStorageSQLite)
871 : {
872 : return NS_ERROR_NOT_IMPLEMENTED;
873 : }
874 :
875 : /* [must_use] readonly attribute int64_t lowMemoryEventsVirtual; */
876 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetLowMemoryEventsVirtual(int64_t *aLowMemoryEventsVirtual)
877 : {
878 : return NS_ERROR_NOT_IMPLEMENTED;
879 : }
880 :
881 : /* [must_use] readonly attribute int64_t lowMemoryEventsPhysical; */
882 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetLowMemoryEventsPhysical(int64_t *aLowMemoryEventsPhysical)
883 : {
884 : return NS_ERROR_NOT_IMPLEMENTED;
885 : }
886 :
887 : /* [must_use] readonly attribute int64_t ghostWindows; */
888 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetGhostWindows(int64_t *aGhostWindows)
889 : {
890 : return NS_ERROR_NOT_IMPLEMENTED;
891 : }
892 :
893 : /* [must_use] readonly attribute int64_t pageFaultsHard; */
894 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetPageFaultsHard(int64_t *aPageFaultsHard)
895 : {
896 : return NS_ERROR_NOT_IMPLEMENTED;
897 : }
898 :
899 : /* [infallible] readonly attribute boolean hasMozMallocUsableSize; */
900 : NS_IMETHODIMP nsMemoryReporterManager::GetHasMozMallocUsableSize(bool *aHasMozMallocUsableSize)
901 : {
902 : return NS_ERROR_NOT_IMPLEMENTED;
903 : }
904 :
905 : /* [infallible] readonly attribute boolean isDMDEnabled; */
906 : NS_IMETHODIMP nsMemoryReporterManager::GetIsDMDEnabled(bool *aIsDMDEnabled)
907 : {
908 : return NS_ERROR_NOT_IMPLEMENTED;
909 : }
910 :
911 : /* [infallible] readonly attribute boolean isDMDRunning; */
912 : NS_IMETHODIMP nsMemoryReporterManager::GetIsDMDRunning(bool *aIsDMDRunning)
913 : {
914 : return NS_ERROR_NOT_IMPLEMENTED;
915 : }
916 :
917 : /* [must_use] void getHeapAllocatedAsync (in nsIHeapAllocatedCallback callback); */
918 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::GetHeapAllocatedAsync(nsIHeapAllocatedCallback *callback)
919 : {
920 : return NS_ERROR_NOT_IMPLEMENTED;
921 : }
922 :
923 : /* [must_use] void minimizeMemoryUsage (in nsIRunnable callback); */
924 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::MinimizeMemoryUsage(nsIRunnable *callback)
925 : {
926 : return NS_ERROR_NOT_IMPLEMENTED;
927 : }
928 :
929 : /* [must_use] void sizeOfTab (in mozIDOMWindowProxy window, out int64_t jsObjectsSize, out int64_t jsStringsSize, out int64_t jsOtherSize, out int64_t domSize, out int64_t styleSize, out int64_t otherSize, out int64_t totalSize, out double jsMilliseconds, out double nonJSMilliseconds); */
930 : MOZ_MUST_USE NS_IMETHODIMP nsMemoryReporterManager::SizeOfTab(mozIDOMWindowProxy *window, int64_t *jsObjectsSize, int64_t *jsStringsSize, int64_t *jsOtherSize, int64_t *domSize, int64_t *styleSize, int64_t *otherSize, int64_t *totalSize, double *jsMilliseconds, double *nonJSMilliseconds)
931 : {
932 : return NS_ERROR_NOT_IMPLEMENTED;
933 : }
934 :
935 : /* End of implementation class template. */
936 : #endif
937 :
938 :
939 : #include "js/TypeDecls.h"
940 : #include "nsStringGlue.h"
941 : #include "nsTArray.h"
942 : class nsPIDOMWindowOuter;
943 : // nsIHandleReportCallback is a better name, but keep nsIMemoryReporterCallback
944 : // around for backwards compatibility.
945 : typedef nsIMemoryReporterCallback nsIHandleReportCallback;
946 : namespace mozilla {
947 : // All the following registration/unregistration functions don't use
948 : // MOZ_MUST_USE because ignoring failures is common and reasonable.
949 : // Register a memory reporter. The manager service will hold a strong
950 : // reference to this reporter.
951 : XPCOM_API(nsresult) RegisterStrongMemoryReporter(nsIMemoryReporter* aReporter);
952 : XPCOM_API(nsresult) RegisterStrongAsyncMemoryReporter(nsIMemoryReporter* aReporter);
953 : // Register a memory reporter. The manager service will hold a weak reference
954 : // to this reporter.
955 : XPCOM_API(nsresult) RegisterWeakMemoryReporter(nsIMemoryReporter* aReporter);
956 : XPCOM_API(nsresult) RegisterWeakAsyncMemoryReporter(nsIMemoryReporter* aReporter);
957 : // Unregister a strong memory reporter.
958 : XPCOM_API(nsresult) UnregisterStrongMemoryReporter(nsIMemoryReporter* aReporter);
959 : // Unregister a weak memory reporter.
960 : XPCOM_API(nsresult) UnregisterWeakMemoryReporter(nsIMemoryReporter* aReporter);
961 : // The memory reporter manager provides access to several distinguished
962 : // amounts via attributes. Some of these amounts are provided by Gecko
963 : // components that cannot be accessed directly from XPCOM code. So we provide
964 : // the following functions for those components to be registered with the
965 : // manager.
966 : typedef int64_t (*InfallibleAmountFn)();
967 : #define DECL_REGISTER_DISTINGUISHED_AMOUNT(kind, name) \
968 : nsresult Register##name##DistinguishedAmount(kind##AmountFn aAmountFn);
969 : #define DECL_UNREGISTER_DISTINGUISHED_AMOUNT(name) \
970 : nsresult Unregister##name##DistinguishedAmount();
971 : DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, JSMainRuntimeGCHeap)
972 : DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, JSMainRuntimeTemporaryPeak)
973 : DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, JSMainRuntimeCompartmentsSystem)
974 : DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, JSMainRuntimeCompartmentsUser)
975 : DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, ImagesContentUsedUncompressed)
976 : DECL_UNREGISTER_DISTINGUISHED_AMOUNT(ImagesContentUsedUncompressed)
977 : DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, StorageSQLite)
978 : DECL_UNREGISTER_DISTINGUISHED_AMOUNT(StorageSQLite)
979 : DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, LowMemoryEventsVirtual)
980 : DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, LowMemoryEventsPhysical)
981 : DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, GhostWindows)
982 : #undef DECL_REGISTER_DISTINGUISHED_AMOUNT
983 : #undef DECL_UNREGISTER_DISTINGUISHED_AMOUNT
984 : // Likewise for per-tab measurement.
985 : typedef MOZ_MUST_USE nsresult (*JSSizeOfTabFn)(JSObject* aObj,
986 : size_t* aJsObjectsSize,
987 : size_t* aJsStringSize,
988 : size_t* aJsPrivateSize,
989 : size_t* aJsOtherSize);
990 : typedef MOZ_MUST_USE nsresult (*NonJSSizeOfTabFn)(nsPIDOMWindowOuter* aWindow,
991 : size_t* aDomSize,
992 : size_t* aStyleSize,
993 : size_t* aOtherSize);
994 : nsresult RegisterJSSizeOfTab(JSSizeOfTabFn aSizeOfTabFn);
995 : nsresult RegisterNonJSSizeOfTab(NonJSSizeOfTabFn aSizeOfTabFn);
996 : }
997 : #if defined(MOZ_DMD)
998 : #if !defined(MOZ_MEMORY)
999 : #error "MOZ_DMD requires MOZ_MEMORY"
1000 : #endif
1001 : #include "DMD.h"
1002 : #define MOZ_REPORT(ptr) mozilla::dmd::Report(ptr)
1003 : #define MOZ_REPORT_ON_ALLOC(ptr) mozilla::dmd::ReportOnAlloc(ptr)
1004 : #else
1005 : #define MOZ_REPORT(ptr)
1006 : #define MOZ_REPORT_ON_ALLOC(ptr)
1007 : #endif // defined(MOZ_DMD)
1008 : // Functions generated via this macro should be used by all traversal-based
1009 : // memory reporters. Such functions return |moz_malloc_size_of(ptr)|; this
1010 : // will always be zero on some obscure platforms.
1011 : //
1012 : // You might be wondering why we have a macro that creates multiple functions
1013 : // that differ only in their name, instead of a single MallocSizeOf function.
1014 : // It's mostly to help with DMD integration, though it sometimes also helps
1015 : // with debugging and temporary ad hoc profiling. The function name chosen
1016 : // doesn't matter greatly, but it's best to make it similar to the path used by
1017 : // the relevant memory reporter(s).
1018 : #define MOZ_DEFINE_MALLOC_SIZE_OF(fn) \
1019 : static size_t fn(const void* aPtr) \
1020 : { \
1021 : MOZ_REPORT(aPtr); \
1022 : return moz_malloc_size_of(aPtr); \
1023 : }
1024 : // Functions generated by the next two macros should be used by wrapping
1025 : // allocators that report heap blocks as soon as they are allocated and
1026 : // unreport them as soon as they are freed. Such allocators are used in cases
1027 : // where we have third-party code that we cannot modify. The two functions
1028 : // must always be used in tandem.
1029 : #define MOZ_DEFINE_MALLOC_SIZE_OF_ON_ALLOC(fn) \
1030 : static size_t fn(const void* aPtr) \
1031 : { \
1032 : MOZ_REPORT_ON_ALLOC(aPtr); \
1033 : return moz_malloc_size_of(aPtr); \
1034 : }
1035 : #define MOZ_DEFINE_MALLOC_SIZE_OF_ON_FREE(fn) \
1036 : static size_t fn(const void* aPtr) \
1037 : { \
1038 : return moz_malloc_size_of(aPtr); \
1039 : }
1040 : // This macro assumes the presence of appropriate |aHandleReport| and |aData|
1041 : // variables. The (void) is there because we should always ignore the return
1042 : // value of the callback, because callback failures aren't fatal.
1043 : #define MOZ_COLLECT_REPORT(path, kind, units, amount, description) \
1044 : (void)aHandleReport->Callback(EmptyCString(), NS_LITERAL_CSTRING(path), \
1045 : kind, units, amount, \
1046 : NS_LITERAL_CSTRING(description), aData)
1047 :
1048 : #endif /* __gen_nsIMemoryReporter_h__ */
|