Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/nsIMemoryReporter.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /src/mozilla-central/xpcom/base/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 "js/GCAnnotations.h"
14
15
#include "mozilla/AlreadyAddRefed.h"
16
#include "mozilla/Assertions.h"
17
#include "mozilla/DebugOnly.h"
18
19
/* For IDL files that don't want to include root IDL files. */
20
#ifndef NS_NO_VTABLE
21
#define NS_NO_VTABLE
22
#endif
23
#include <stdio.h>
24
class mozIDOMWindowProxy; /* forward declaration */
25
26
class nsIRunnable; /* forward declaration */
27
28
class nsISimpleEnumerator; /* forward declaration */
29
30
31
/* starting interface:    nsIHandleReportCallback */
32
#define NS_IHANDLEREPORTCALLBACK_IID_STR "62ef0e1c-dbd6-11e3-aa75-3c970e9f4238"
33
34
#define NS_IHANDLEREPORTCALLBACK_IID \
35
  {0x62ef0e1c, 0xdbd6, 0x11e3, \
36
    { 0xaa, 0x75, 0x3c, 0x97, 0x0e, 0x9f, 0x42, 0x38 }}
37
38
class NS_NO_VTABLE nsIHandleReportCallback : public nsISupports {
39
 public:
40
41
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHANDLEREPORTCALLBACK_IID)
42
43
  /* 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); */
44
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Callback(const nsACString& process, const nsACString& path, int32_t kind, int32_t units, int64_t amount, const nsACString& description, nsISupports *data) = 0;
45
46
};
47
48
  NS_DEFINE_STATIC_IID_ACCESSOR(nsIHandleReportCallback, NS_IHANDLEREPORTCALLBACK_IID)
49
50
/* Use this macro when declaring classes that implement this interface. */
51
#define NS_DECL_NSIHANDLEREPORTCALLBACK \
52
  NS_IMETHOD Callback(const nsACString& process, const nsACString& path, int32_t kind, int32_t units, int64_t amount, const nsACString& description, nsISupports *data) override; 
53
54
/* Use this macro when declaring the members of this interface when the
55
   class doesn't implement the interface. This is useful for forwarding. */
56
#define NS_DECL_NON_VIRTUAL_NSIHANDLEREPORTCALLBACK \
57
  nsresult Callback(const nsACString& process, const nsACString& path, int32_t kind, int32_t units, int64_t amount, const nsACString& description, nsISupports *data); 
58
59
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
60
#define NS_FORWARD_NSIHANDLEREPORTCALLBACK(_to) \
61
  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); } 
62
63
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
64
#define NS_FORWARD_SAFE_NSIHANDLEREPORTCALLBACK(_to) \
65
  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); } 
66
67
68
/* starting interface:    nsIMemoryReporter */
69
#define NS_IMEMORYREPORTER_IID_STR "92a36db1-46bd-4fe6-988e-47db47236d8b"
70
71
#define NS_IMEMORYREPORTER_IID \
72
  {0x92a36db1, 0x46bd, 0x4fe6, \
73
    { 0x98, 0x8e, 0x47, 0xdb, 0x47, 0x23, 0x6d, 0x8b }}
74
75
class NS_NO_VTABLE nsIMemoryReporter : public nsISupports {
76
 public:
77
78
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMEMORYREPORTER_IID)
79
80
  /* void collectReports (in nsIHandleReportCallback callback, in nsISupports data, in boolean anonymize); */
81
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD CollectReports(nsIHandleReportCallback *callback, nsISupports *data, bool anonymize) = 0;
82
83
  enum {
84
    KIND_NONHEAP = 0,
85
    KIND_HEAP = 1,
86
    KIND_OTHER = 2,
87
    UNITS_BYTES = 0,
88
    UNITS_COUNT = 1,
89
    UNITS_COUNT_CUMULATIVE = 2,
90
    UNITS_PERCENTAGE = 3
91
  };
92
93
};
94
95
  NS_DEFINE_STATIC_IID_ACCESSOR(nsIMemoryReporter, NS_IMEMORYREPORTER_IID)
96
97
/* Use this macro when declaring classes that implement this interface. */
98
#define NS_DECL_NSIMEMORYREPORTER \
99
  NS_IMETHOD CollectReports(nsIHandleReportCallback *callback, nsISupports *data, bool anonymize) override; \
100
101
/* Use this macro when declaring the members of this interface when the
102
   class doesn't implement the interface. This is useful for forwarding. */
103
#define NS_DECL_NON_VIRTUAL_NSIMEMORYREPORTER \
104
  nsresult CollectReports(nsIHandleReportCallback *callback, nsISupports *data, bool anonymize); \
105
106
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
107
#define NS_FORWARD_NSIMEMORYREPORTER(_to) \
108
  NS_IMETHOD CollectReports(nsIHandleReportCallback *callback, nsISupports *data, bool anonymize) override { return _to CollectReports(callback, data, anonymize); } \
109
110
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
111
#define NS_FORWARD_SAFE_NSIMEMORYREPORTER(_to) \
112
  NS_IMETHOD CollectReports(nsIHandleReportCallback *callback, nsISupports *data, bool anonymize) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CollectReports(callback, data, anonymize); } \
113
114
115
/* starting interface:    nsIFinishReportingCallback */
116
#define NS_IFINISHREPORTINGCALLBACK_IID_STR "548b3909-c04d-4ca6-8466-b8bee3837457"
117
118
#define NS_IFINISHREPORTINGCALLBACK_IID \
119
  {0x548b3909, 0xc04d, 0x4ca6, \
120
    { 0x84, 0x66, 0xb8, 0xbe, 0xe3, 0x83, 0x74, 0x57 }}
121
122
class NS_NO_VTABLE nsIFinishReportingCallback : public nsISupports {
123
 public:
124
125
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFINISHREPORTINGCALLBACK_IID)
126
127
  /* void callback (in nsISupports data); */
128
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Callback(nsISupports *data) = 0;
129
130
};
131
132
  NS_DEFINE_STATIC_IID_ACCESSOR(nsIFinishReportingCallback, NS_IFINISHREPORTINGCALLBACK_IID)
133
134
/* Use this macro when declaring classes that implement this interface. */
135
#define NS_DECL_NSIFINISHREPORTINGCALLBACK \
136
  NS_IMETHOD Callback(nsISupports *data) override; 
137
138
/* Use this macro when declaring the members of this interface when the
139
   class doesn't implement the interface. This is useful for forwarding. */
140
#define NS_DECL_NON_VIRTUAL_NSIFINISHREPORTINGCALLBACK \
141
  nsresult Callback(nsISupports *data); 
142
143
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
144
#define NS_FORWARD_NSIFINISHREPORTINGCALLBACK(_to) \
145
  NS_IMETHOD Callback(nsISupports *data) override { return _to Callback(data); } 
146
147
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
148
#define NS_FORWARD_SAFE_NSIFINISHREPORTINGCALLBACK(_to) \
149
  NS_IMETHOD Callback(nsISupports *data) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Callback(data); } 
150
151
152
/* starting interface:    nsIHeapAllocatedCallback */
153
#define NS_IHEAPALLOCATEDCALLBACK_IID_STR "1a80cd0f-0d9e-4397-be69-68ad28fe5175"
154
155
#define NS_IHEAPALLOCATEDCALLBACK_IID \
156
  {0x1a80cd0f, 0x0d9e, 0x4397, \
157
    { 0xbe, 0x69, 0x68, 0xad, 0x28, 0xfe, 0x51, 0x75 }}
158
159
class NS_NO_VTABLE nsIHeapAllocatedCallback : public nsISupports {
160
 public:
161
162
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHEAPALLOCATEDCALLBACK_IID)
163
164
  /* void callback (in int64_t bytesAllocated); */
165
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Callback(int64_t bytesAllocated) = 0;
166
167
};
168
169
  NS_DEFINE_STATIC_IID_ACCESSOR(nsIHeapAllocatedCallback, NS_IHEAPALLOCATEDCALLBACK_IID)
170
171
/* Use this macro when declaring classes that implement this interface. */
172
#define NS_DECL_NSIHEAPALLOCATEDCALLBACK \
173
  NS_IMETHOD Callback(int64_t bytesAllocated) override; 
174
175
/* Use this macro when declaring the members of this interface when the
176
   class doesn't implement the interface. This is useful for forwarding. */
177
#define NS_DECL_NON_VIRTUAL_NSIHEAPALLOCATEDCALLBACK \
178
  nsresult Callback(int64_t bytesAllocated); 
179
180
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
181
#define NS_FORWARD_NSIHEAPALLOCATEDCALLBACK(_to) \
182
  NS_IMETHOD Callback(int64_t bytesAllocated) override { return _to Callback(bytesAllocated); } 
183
184
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
185
#define NS_FORWARD_SAFE_NSIHEAPALLOCATEDCALLBACK(_to) \
186
  NS_IMETHOD Callback(int64_t bytesAllocated) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Callback(bytesAllocated); } 
187
188
189
/* starting interface:    nsIMemoryReporterManager */
190
#define NS_IMEMORYREPORTERMANAGER_IID_STR "2998574d-8993-407a-b1a5-8ad7417653e1"
191
192
#define NS_IMEMORYREPORTERMANAGER_IID \
193
  {0x2998574d, 0x8993, 0x407a, \
194
    { 0xb1, 0xa5, 0x8a, 0xd7, 0x41, 0x76, 0x53, 0xe1 }}
195
196
class NS_NO_VTABLE nsIMemoryReporterManager : public nsISupports {
197
 public:
198
199
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMEMORYREPORTERMANAGER_IID)
200
201
  /* [must_use] void init (); */
202
  MOZ_MUST_USE NS_IMETHOD Init(void) = 0;
203
204
  /* void registerStrongReporter (in nsIMemoryReporter reporter); */
205
  NS_IMETHOD RegisterStrongReporter(nsIMemoryReporter *reporter) = 0;
206
207
  /* void registerStrongAsyncReporter (in nsIMemoryReporter reporter); */
208
  NS_IMETHOD RegisterStrongAsyncReporter(nsIMemoryReporter *reporter) = 0;
209
210
  /* void registerWeakReporter (in nsIMemoryReporter reporter); */
211
  NS_IMETHOD RegisterWeakReporter(nsIMemoryReporter *reporter) = 0;
212
213
  /* void registerWeakAsyncReporter (in nsIMemoryReporter reporter); */
214
  NS_IMETHOD RegisterWeakAsyncReporter(nsIMemoryReporter *reporter) = 0;
215
216
  /* void unregisterStrongReporter (in nsIMemoryReporter reporter); */
217
  NS_IMETHOD UnregisterStrongReporter(nsIMemoryReporter *reporter) = 0;
218
219
  /* void unregisterWeakReporter (in nsIMemoryReporter reporter); */
220
  NS_IMETHOD UnregisterWeakReporter(nsIMemoryReporter *reporter) = 0;
221
222
  /* void blockRegistrationAndHideExistingReporters (); */
223
  NS_IMETHOD BlockRegistrationAndHideExistingReporters(void) = 0;
224
225
  /* void unblockRegistrationAndRestoreOriginalReporters (); */
226
  NS_IMETHOD UnblockRegistrationAndRestoreOriginalReporters(void) = 0;
227
228
  /* void registerStrongReporterEvenIfBlocked (in nsIMemoryReporter aReporter); */
229
  NS_IMETHOD RegisterStrongReporterEvenIfBlocked(nsIMemoryReporter *aReporter) = 0;
230
231
  /* void getReports (in nsIHandleReportCallback handleReport, in nsISupports handleReportData, in nsIFinishReportingCallback finishReporting, in nsISupports finishReportingData, in boolean anonymize); */
232
  NS_IMETHOD GetReports(nsIHandleReportCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize) = 0;
233
234
  /* [noscript] void getReportsExtended (in nsIHandleReportCallback handleReport, in nsISupports handleReportData, in nsIFinishReportingCallback finishReporting, in nsISupports finishReportingData, in boolean anonymize, in boolean minimizeMemoryUsage, in AString DMDDumpIdent); */
235
  NS_IMETHOD GetReportsExtended(nsIHandleReportCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize, bool minimizeMemoryUsage, const nsAString& DMDDumpIdent) = 0;
236
237
  /* [noscript] void getReportsForThisProcessExtended (in nsIHandleReportCallback handleReport, in nsISupports handleReportData, in boolean anonymize, in FILE DMDFile, in nsIFinishReportingCallback finishReporting, in nsISupports finishReportingData); */
238
  NS_IMETHOD GetReportsForThisProcessExtended(nsIHandleReportCallback *handleReport, nsISupports *handleReportData, bool anonymize, FILE * DMDFile, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData) = 0;
239
240
  /* [noscript] void endReport (); */
241
  NS_IMETHOD EndReport(void) = 0;
242
243
  /* [must_use] readonly attribute int64_t vsize; */
244
  MOZ_MUST_USE NS_IMETHOD GetVsize(int64_t *aVsize) = 0;
245
246
  /* [must_use] readonly attribute int64_t vsizeMaxContiguous; */
247
  MOZ_MUST_USE NS_IMETHOD GetVsizeMaxContiguous(int64_t *aVsizeMaxContiguous) = 0;
248
249
  /* [must_use] readonly attribute int64_t resident; */
250
  MOZ_MUST_USE NS_IMETHOD GetResident(int64_t *aResident) = 0;
251
252
  /* [must_use] readonly attribute int64_t residentFast; */
253
  MOZ_MUST_USE NS_IMETHOD GetResidentFast(int64_t *aResidentFast) = 0;
254
255
  /* [must_use] readonly attribute int64_t residentPeak; */
256
  MOZ_MUST_USE NS_IMETHOD GetResidentPeak(int64_t *aResidentPeak) = 0;
257
258
  /* [must_use] readonly attribute int64_t residentUnique; */
259
  MOZ_MUST_USE NS_IMETHOD GetResidentUnique(int64_t *aResidentUnique) = 0;
260
261
  /* [must_use] readonly attribute int64_t heapAllocated; */
262
  MOZ_MUST_USE NS_IMETHOD GetHeapAllocated(int64_t *aHeapAllocated) = 0;
263
264
  /* [must_use] readonly attribute int64_t heapOverheadFraction; */
265
  MOZ_MUST_USE NS_IMETHOD GetHeapOverheadFraction(int64_t *aHeapOverheadFraction) = 0;
266
267
  /* [must_use] readonly attribute int64_t JSMainRuntimeGCHeap; */
268
  MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeGCHeap(int64_t *aJSMainRuntimeGCHeap) = 0;
269
270
  /* [must_use] readonly attribute int64_t JSMainRuntimeTemporaryPeak; */
271
  MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeTemporaryPeak(int64_t *aJSMainRuntimeTemporaryPeak) = 0;
272
273
  /* [must_use] readonly attribute int64_t JSMainRuntimeRealmsSystem; */
274
  MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeRealmsSystem(int64_t *aJSMainRuntimeRealmsSystem) = 0;
275
276
  /* [must_use] readonly attribute int64_t JSMainRuntimeRealmsUser; */
277
  MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeRealmsUser(int64_t *aJSMainRuntimeRealmsUser) = 0;
278
279
  /* [must_use] readonly attribute int64_t imagesContentUsedUncompressed; */
280
  MOZ_MUST_USE NS_IMETHOD GetImagesContentUsedUncompressed(int64_t *aImagesContentUsedUncompressed) = 0;
281
282
  /* [must_use] readonly attribute int64_t storageSQLite; */
283
  MOZ_MUST_USE NS_IMETHOD GetStorageSQLite(int64_t *aStorageSQLite) = 0;
284
285
  /* [must_use] readonly attribute int64_t lowMemoryEventsVirtual; */
286
  MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsVirtual(int64_t *aLowMemoryEventsVirtual) = 0;
287
288
  /* [must_use] readonly attribute int64_t lowMemoryEventsCommitSpace; */
289
  MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsCommitSpace(int64_t *aLowMemoryEventsCommitSpace) = 0;
290
291
  /* [must_use] readonly attribute int64_t lowMemoryEventsPhysical; */
292
  MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsPhysical(int64_t *aLowMemoryEventsPhysical) = 0;
293
294
  /* [must_use] readonly attribute int64_t ghostWindows; */
295
  MOZ_MUST_USE NS_IMETHOD GetGhostWindows(int64_t *aGhostWindows) = 0;
296
297
  /* [must_use] readonly attribute int64_t pageFaultsHard; */
298
  MOZ_MUST_USE NS_IMETHOD GetPageFaultsHard(int64_t *aPageFaultsHard) = 0;
299
300
  /* [infallible] readonly attribute boolean hasMozMallocUsableSize; */
301
  NS_IMETHOD GetHasMozMallocUsableSize(bool *aHasMozMallocUsableSize) = 0;
302
  inline bool GetHasMozMallocUsableSize()
303
0
  {
304
0
    bool result;
305
0
    mozilla::DebugOnly<nsresult> rv = GetHasMozMallocUsableSize(&result);
306
0
    MOZ_ASSERT(NS_SUCCEEDED(rv));
307
0
    return result;
308
0
  }
309
310
  /* [infallible] readonly attribute boolean isDMDEnabled; */
311
  NS_IMETHOD GetIsDMDEnabled(bool *aIsDMDEnabled) = 0;
312
  inline bool GetIsDMDEnabled()
313
0
  {
314
0
    bool result;
315
0
    mozilla::DebugOnly<nsresult> rv = GetIsDMDEnabled(&result);
316
0
    MOZ_ASSERT(NS_SUCCEEDED(rv));
317
0
    return result;
318
0
  }
319
320
  /* [infallible] readonly attribute boolean isDMDRunning; */
321
  NS_IMETHOD GetIsDMDRunning(bool *aIsDMDRunning) = 0;
322
  inline bool GetIsDMDRunning()
323
0
  {
324
0
    bool result;
325
0
    mozilla::DebugOnly<nsresult> rv = GetIsDMDRunning(&result);
326
0
    MOZ_ASSERT(NS_SUCCEEDED(rv));
327
0
    return result;
328
0
  }
329
330
  /* [must_use] void getHeapAllocatedAsync (in nsIHeapAllocatedCallback callback); */
331
  MOZ_MUST_USE NS_IMETHOD GetHeapAllocatedAsync(nsIHeapAllocatedCallback *callback) = 0;
332
333
  /* [must_use] void minimizeMemoryUsage (in nsIRunnable callback); */
334
  MOZ_MUST_USE NS_IMETHOD MinimizeMemoryUsage(nsIRunnable *callback) = 0;
335
336
  /* [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); */
337
  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;
338
339
};
340
341
  NS_DEFINE_STATIC_IID_ACCESSOR(nsIMemoryReporterManager, NS_IMEMORYREPORTERMANAGER_IID)
342
343
/* Use this macro when declaring classes that implement this interface. */
344
#define NS_DECL_NSIMEMORYREPORTERMANAGER \
345
  MOZ_MUST_USE NS_IMETHOD Init(void) override; \
346
  NS_IMETHOD RegisterStrongReporter(nsIMemoryReporter *reporter) override; \
347
  NS_IMETHOD RegisterStrongAsyncReporter(nsIMemoryReporter *reporter) override; \
348
  NS_IMETHOD RegisterWeakReporter(nsIMemoryReporter *reporter) override; \
349
  NS_IMETHOD RegisterWeakAsyncReporter(nsIMemoryReporter *reporter) override; \
350
  NS_IMETHOD UnregisterStrongReporter(nsIMemoryReporter *reporter) override; \
351
  NS_IMETHOD UnregisterWeakReporter(nsIMemoryReporter *reporter) override; \
352
  NS_IMETHOD BlockRegistrationAndHideExistingReporters(void) override; \
353
  NS_IMETHOD UnblockRegistrationAndRestoreOriginalReporters(void) override; \
354
  NS_IMETHOD RegisterStrongReporterEvenIfBlocked(nsIMemoryReporter *aReporter) override; \
355
  NS_IMETHOD GetReports(nsIHandleReportCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize) override; \
356
  NS_IMETHOD GetReportsExtended(nsIHandleReportCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize, bool minimizeMemoryUsage, const nsAString& DMDDumpIdent) override; \
357
  NS_IMETHOD GetReportsForThisProcessExtended(nsIHandleReportCallback *handleReport, nsISupports *handleReportData, bool anonymize, FILE * DMDFile, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData) override; \
358
  NS_IMETHOD EndReport(void) override; \
359
  MOZ_MUST_USE NS_IMETHOD GetVsize(int64_t *aVsize) override; \
360
  MOZ_MUST_USE NS_IMETHOD GetVsizeMaxContiguous(int64_t *aVsizeMaxContiguous) override; \
361
  MOZ_MUST_USE NS_IMETHOD GetResident(int64_t *aResident) override; \
362
  MOZ_MUST_USE NS_IMETHOD GetResidentFast(int64_t *aResidentFast) override; \
363
  MOZ_MUST_USE NS_IMETHOD GetResidentPeak(int64_t *aResidentPeak) override; \
364
  MOZ_MUST_USE NS_IMETHOD GetResidentUnique(int64_t *aResidentUnique) override; \
365
  MOZ_MUST_USE NS_IMETHOD GetHeapAllocated(int64_t *aHeapAllocated) override; \
366
  MOZ_MUST_USE NS_IMETHOD GetHeapOverheadFraction(int64_t *aHeapOverheadFraction) override; \
367
  MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeGCHeap(int64_t *aJSMainRuntimeGCHeap) override; \
368
  MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeTemporaryPeak(int64_t *aJSMainRuntimeTemporaryPeak) override; \
369
  MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeRealmsSystem(int64_t *aJSMainRuntimeRealmsSystem) override; \
370
  MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeRealmsUser(int64_t *aJSMainRuntimeRealmsUser) override; \
371
  MOZ_MUST_USE NS_IMETHOD GetImagesContentUsedUncompressed(int64_t *aImagesContentUsedUncompressed) override; \
372
  MOZ_MUST_USE NS_IMETHOD GetStorageSQLite(int64_t *aStorageSQLite) override; \
373
  MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsVirtual(int64_t *aLowMemoryEventsVirtual) override; \
374
  MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsCommitSpace(int64_t *aLowMemoryEventsCommitSpace) override; \
375
  MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsPhysical(int64_t *aLowMemoryEventsPhysical) override; \
376
  MOZ_MUST_USE NS_IMETHOD GetGhostWindows(int64_t *aGhostWindows) override; \
377
  MOZ_MUST_USE NS_IMETHOD GetPageFaultsHard(int64_t *aPageFaultsHard) override; \
378
  using nsIMemoryReporterManager::GetHasMozMallocUsableSize; \
379
  NS_IMETHOD GetHasMozMallocUsableSize(bool *aHasMozMallocUsableSize) override; \
380
  using nsIMemoryReporterManager::GetIsDMDEnabled; \
381
  NS_IMETHOD GetIsDMDEnabled(bool *aIsDMDEnabled) override; \
382
  using nsIMemoryReporterManager::GetIsDMDRunning; \
383
  NS_IMETHOD GetIsDMDRunning(bool *aIsDMDRunning) override; \
384
  MOZ_MUST_USE NS_IMETHOD GetHeapAllocatedAsync(nsIHeapAllocatedCallback *callback) override; \
385
  MOZ_MUST_USE NS_IMETHOD MinimizeMemoryUsage(nsIRunnable *callback) override; \
386
  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; 
387
388
/* Use this macro when declaring the members of this interface when the
389
   class doesn't implement the interface. This is useful for forwarding. */
390
#define NS_DECL_NON_VIRTUAL_NSIMEMORYREPORTERMANAGER \
391
  MOZ_MUST_USE nsresult Init(void); \
392
  nsresult RegisterStrongReporter(nsIMemoryReporter *reporter); \
393
  nsresult RegisterStrongAsyncReporter(nsIMemoryReporter *reporter); \
394
  nsresult RegisterWeakReporter(nsIMemoryReporter *reporter); \
395
  nsresult RegisterWeakAsyncReporter(nsIMemoryReporter *reporter); \
396
  nsresult UnregisterStrongReporter(nsIMemoryReporter *reporter); \
397
  nsresult UnregisterWeakReporter(nsIMemoryReporter *reporter); \
398
  nsresult BlockRegistrationAndHideExistingReporters(void); \
399
  nsresult UnblockRegistrationAndRestoreOriginalReporters(void); \
400
  nsresult RegisterStrongReporterEvenIfBlocked(nsIMemoryReporter *aReporter); \
401
  nsresult GetReports(nsIHandleReportCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize); \
402
  nsresult GetReportsExtended(nsIHandleReportCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize, bool minimizeMemoryUsage, const nsAString& DMDDumpIdent); \
403
  nsresult GetReportsForThisProcessExtended(nsIHandleReportCallback *handleReport, nsISupports *handleReportData, bool anonymize, FILE * DMDFile, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData); \
404
  nsresult EndReport(void); \
405
  MOZ_MUST_USE nsresult GetVsize(int64_t *aVsize); \
406
  MOZ_MUST_USE nsresult GetVsizeMaxContiguous(int64_t *aVsizeMaxContiguous); \
407
  MOZ_MUST_USE nsresult GetResident(int64_t *aResident); \
408
  MOZ_MUST_USE nsresult GetResidentFast(int64_t *aResidentFast); \
409
  MOZ_MUST_USE nsresult GetResidentPeak(int64_t *aResidentPeak); \
410
  MOZ_MUST_USE nsresult GetResidentUnique(int64_t *aResidentUnique); \
411
  MOZ_MUST_USE nsresult GetHeapAllocated(int64_t *aHeapAllocated); \
412
  MOZ_MUST_USE nsresult GetHeapOverheadFraction(int64_t *aHeapOverheadFraction); \
413
  MOZ_MUST_USE nsresult GetJSMainRuntimeGCHeap(int64_t *aJSMainRuntimeGCHeap); \
414
  MOZ_MUST_USE nsresult GetJSMainRuntimeTemporaryPeak(int64_t *aJSMainRuntimeTemporaryPeak); \
415
  MOZ_MUST_USE nsresult GetJSMainRuntimeRealmsSystem(int64_t *aJSMainRuntimeRealmsSystem); \
416
  MOZ_MUST_USE nsresult GetJSMainRuntimeRealmsUser(int64_t *aJSMainRuntimeRealmsUser); \
417
  MOZ_MUST_USE nsresult GetImagesContentUsedUncompressed(int64_t *aImagesContentUsedUncompressed); \
418
  MOZ_MUST_USE nsresult GetStorageSQLite(int64_t *aStorageSQLite); \
419
  MOZ_MUST_USE nsresult GetLowMemoryEventsVirtual(int64_t *aLowMemoryEventsVirtual); \
420
  MOZ_MUST_USE nsresult GetLowMemoryEventsCommitSpace(int64_t *aLowMemoryEventsCommitSpace); \
421
  MOZ_MUST_USE nsresult GetLowMemoryEventsPhysical(int64_t *aLowMemoryEventsPhysical); \
422
  MOZ_MUST_USE nsresult GetGhostWindows(int64_t *aGhostWindows); \
423
  MOZ_MUST_USE nsresult GetPageFaultsHard(int64_t *aPageFaultsHard); \
424
  using nsIMemoryReporterManager::GetHasMozMallocUsableSize; \
425
  nsresult GetHasMozMallocUsableSize(bool *aHasMozMallocUsableSize); \
426
  using nsIMemoryReporterManager::GetIsDMDEnabled; \
427
  nsresult GetIsDMDEnabled(bool *aIsDMDEnabled); \
428
  using nsIMemoryReporterManager::GetIsDMDRunning; \
429
  nsresult GetIsDMDRunning(bool *aIsDMDRunning); \
430
  MOZ_MUST_USE nsresult GetHeapAllocatedAsync(nsIHeapAllocatedCallback *callback); \
431
  MOZ_MUST_USE nsresult MinimizeMemoryUsage(nsIRunnable *callback); \
432
  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); 
433
434
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
435
#define NS_FORWARD_NSIMEMORYREPORTERMANAGER(_to) \
436
  MOZ_MUST_USE NS_IMETHOD Init(void) override { return _to Init(); } \
437
  NS_IMETHOD RegisterStrongReporter(nsIMemoryReporter *reporter) override { return _to RegisterStrongReporter(reporter); } \
438
  NS_IMETHOD RegisterStrongAsyncReporter(nsIMemoryReporter *reporter) override { return _to RegisterStrongAsyncReporter(reporter); } \
439
  NS_IMETHOD RegisterWeakReporter(nsIMemoryReporter *reporter) override { return _to RegisterWeakReporter(reporter); } \
440
  NS_IMETHOD RegisterWeakAsyncReporter(nsIMemoryReporter *reporter) override { return _to RegisterWeakAsyncReporter(reporter); } \
441
  NS_IMETHOD UnregisterStrongReporter(nsIMemoryReporter *reporter) override { return _to UnregisterStrongReporter(reporter); } \
442
  NS_IMETHOD UnregisterWeakReporter(nsIMemoryReporter *reporter) override { return _to UnregisterWeakReporter(reporter); } \
443
  NS_IMETHOD BlockRegistrationAndHideExistingReporters(void) override { return _to BlockRegistrationAndHideExistingReporters(); } \
444
  NS_IMETHOD UnblockRegistrationAndRestoreOriginalReporters(void) override { return _to UnblockRegistrationAndRestoreOriginalReporters(); } \
445
  NS_IMETHOD RegisterStrongReporterEvenIfBlocked(nsIMemoryReporter *aReporter) override { return _to RegisterStrongReporterEvenIfBlocked(aReporter); } \
446
  NS_IMETHOD GetReports(nsIHandleReportCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize) override { return _to GetReports(handleReport, handleReportData, finishReporting, finishReportingData, anonymize); } \
447
  NS_IMETHOD GetReportsExtended(nsIHandleReportCallback *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); } \
448
  NS_IMETHOD GetReportsForThisProcessExtended(nsIHandleReportCallback *handleReport, nsISupports *handleReportData, bool anonymize, FILE * DMDFile, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData) override { return _to GetReportsForThisProcessExtended(handleReport, handleReportData, anonymize, DMDFile, finishReporting, finishReportingData); } \
449
  NS_IMETHOD EndReport(void) override { return _to EndReport(); } \
450
  MOZ_MUST_USE NS_IMETHOD GetVsize(int64_t *aVsize) override { return _to GetVsize(aVsize); } \
451
  MOZ_MUST_USE NS_IMETHOD GetVsizeMaxContiguous(int64_t *aVsizeMaxContiguous) override { return _to GetVsizeMaxContiguous(aVsizeMaxContiguous); } \
452
  MOZ_MUST_USE NS_IMETHOD GetResident(int64_t *aResident) override { return _to GetResident(aResident); } \
453
  MOZ_MUST_USE NS_IMETHOD GetResidentFast(int64_t *aResidentFast) override { return _to GetResidentFast(aResidentFast); } \
454
  MOZ_MUST_USE NS_IMETHOD GetResidentPeak(int64_t *aResidentPeak) override { return _to GetResidentPeak(aResidentPeak); } \
455
  MOZ_MUST_USE NS_IMETHOD GetResidentUnique(int64_t *aResidentUnique) override { return _to GetResidentUnique(aResidentUnique); } \
456
  MOZ_MUST_USE NS_IMETHOD GetHeapAllocated(int64_t *aHeapAllocated) override { return _to GetHeapAllocated(aHeapAllocated); } \
457
  MOZ_MUST_USE NS_IMETHOD GetHeapOverheadFraction(int64_t *aHeapOverheadFraction) override { return _to GetHeapOverheadFraction(aHeapOverheadFraction); } \
458
  MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeGCHeap(int64_t *aJSMainRuntimeGCHeap) override { return _to GetJSMainRuntimeGCHeap(aJSMainRuntimeGCHeap); } \
459
  MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeTemporaryPeak(int64_t *aJSMainRuntimeTemporaryPeak) override { return _to GetJSMainRuntimeTemporaryPeak(aJSMainRuntimeTemporaryPeak); } \
460
  MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeRealmsSystem(int64_t *aJSMainRuntimeRealmsSystem) override { return _to GetJSMainRuntimeRealmsSystem(aJSMainRuntimeRealmsSystem); } \
461
  MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeRealmsUser(int64_t *aJSMainRuntimeRealmsUser) override { return _to GetJSMainRuntimeRealmsUser(aJSMainRuntimeRealmsUser); } \
462
  MOZ_MUST_USE NS_IMETHOD GetImagesContentUsedUncompressed(int64_t *aImagesContentUsedUncompressed) override { return _to GetImagesContentUsedUncompressed(aImagesContentUsedUncompressed); } \
463
  MOZ_MUST_USE NS_IMETHOD GetStorageSQLite(int64_t *aStorageSQLite) override { return _to GetStorageSQLite(aStorageSQLite); } \
464
  MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsVirtual(int64_t *aLowMemoryEventsVirtual) override { return _to GetLowMemoryEventsVirtual(aLowMemoryEventsVirtual); } \
465
  MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsCommitSpace(int64_t *aLowMemoryEventsCommitSpace) override { return _to GetLowMemoryEventsCommitSpace(aLowMemoryEventsCommitSpace); } \
466
  MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsPhysical(int64_t *aLowMemoryEventsPhysical) override { return _to GetLowMemoryEventsPhysical(aLowMemoryEventsPhysical); } \
467
  MOZ_MUST_USE NS_IMETHOD GetGhostWindows(int64_t *aGhostWindows) override { return _to GetGhostWindows(aGhostWindows); } \
468
  MOZ_MUST_USE NS_IMETHOD GetPageFaultsHard(int64_t *aPageFaultsHard) override { return _to GetPageFaultsHard(aPageFaultsHard); } \
469
  using nsIMemoryReporterManager::GetHasMozMallocUsableSize; \
470
  NS_IMETHOD GetHasMozMallocUsableSize(bool *aHasMozMallocUsableSize) override { return _to GetHasMozMallocUsableSize(aHasMozMallocUsableSize); } \
471
  using nsIMemoryReporterManager::GetIsDMDEnabled; \
472
  NS_IMETHOD GetIsDMDEnabled(bool *aIsDMDEnabled) override { return _to GetIsDMDEnabled(aIsDMDEnabled); } \
473
  using nsIMemoryReporterManager::GetIsDMDRunning; \
474
  NS_IMETHOD GetIsDMDRunning(bool *aIsDMDRunning) override { return _to GetIsDMDRunning(aIsDMDRunning); } \
475
  MOZ_MUST_USE NS_IMETHOD GetHeapAllocatedAsync(nsIHeapAllocatedCallback *callback) override { return _to GetHeapAllocatedAsync(callback); } \
476
  MOZ_MUST_USE NS_IMETHOD MinimizeMemoryUsage(nsIRunnable *callback) override { return _to MinimizeMemoryUsage(callback); } \
477
  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); } 
478
479
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
480
#define NS_FORWARD_SAFE_NSIMEMORYREPORTERMANAGER(_to) \
481
  MOZ_MUST_USE NS_IMETHOD Init(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(); } \
482
  NS_IMETHOD RegisterStrongReporter(nsIMemoryReporter *reporter) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterStrongReporter(reporter); } \
483
  NS_IMETHOD RegisterStrongAsyncReporter(nsIMemoryReporter *reporter) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterStrongAsyncReporter(reporter); } \
484
  NS_IMETHOD RegisterWeakReporter(nsIMemoryReporter *reporter) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterWeakReporter(reporter); } \
485
  NS_IMETHOD RegisterWeakAsyncReporter(nsIMemoryReporter *reporter) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterWeakAsyncReporter(reporter); } \
486
  NS_IMETHOD UnregisterStrongReporter(nsIMemoryReporter *reporter) override { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterStrongReporter(reporter); } \
487
  NS_IMETHOD UnregisterWeakReporter(nsIMemoryReporter *reporter) override { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterWeakReporter(reporter); } \
488
  NS_IMETHOD BlockRegistrationAndHideExistingReporters(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->BlockRegistrationAndHideExistingReporters(); } \
489
  NS_IMETHOD UnblockRegistrationAndRestoreOriginalReporters(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->UnblockRegistrationAndRestoreOriginalReporters(); } \
490
  NS_IMETHOD RegisterStrongReporterEvenIfBlocked(nsIMemoryReporter *aReporter) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterStrongReporterEvenIfBlocked(aReporter); } \
491
  NS_IMETHOD GetReports(nsIHandleReportCallback *handleReport, nsISupports *handleReportData, nsIFinishReportingCallback *finishReporting, nsISupports *finishReportingData, bool anonymize) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetReports(handleReport, handleReportData, finishReporting, finishReportingData, anonymize); } \
492
  NS_IMETHOD GetReportsExtended(nsIHandleReportCallback *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); } \
493
  NS_IMETHOD GetReportsForThisProcessExtended(nsIHandleReportCallback *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); } \
494
  NS_IMETHOD EndReport(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->EndReport(); } \
495
  MOZ_MUST_USE NS_IMETHOD GetVsize(int64_t *aVsize) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetVsize(aVsize); } \
496
  MOZ_MUST_USE NS_IMETHOD GetVsizeMaxContiguous(int64_t *aVsizeMaxContiguous) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetVsizeMaxContiguous(aVsizeMaxContiguous); } \
497
  MOZ_MUST_USE NS_IMETHOD GetResident(int64_t *aResident) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResident(aResident); } \
498
  MOZ_MUST_USE NS_IMETHOD GetResidentFast(int64_t *aResidentFast) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResidentFast(aResidentFast); } \
499
  MOZ_MUST_USE NS_IMETHOD GetResidentPeak(int64_t *aResidentPeak) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResidentPeak(aResidentPeak); } \
500
  MOZ_MUST_USE NS_IMETHOD GetResidentUnique(int64_t *aResidentUnique) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResidentUnique(aResidentUnique); } \
501
  MOZ_MUST_USE NS_IMETHOD GetHeapAllocated(int64_t *aHeapAllocated) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHeapAllocated(aHeapAllocated); } \
502
  MOZ_MUST_USE NS_IMETHOD GetHeapOverheadFraction(int64_t *aHeapOverheadFraction) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHeapOverheadFraction(aHeapOverheadFraction); } \
503
  MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeGCHeap(int64_t *aJSMainRuntimeGCHeap) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetJSMainRuntimeGCHeap(aJSMainRuntimeGCHeap); } \
504
  MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeTemporaryPeak(int64_t *aJSMainRuntimeTemporaryPeak) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetJSMainRuntimeTemporaryPeak(aJSMainRuntimeTemporaryPeak); } \
505
  MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeRealmsSystem(int64_t *aJSMainRuntimeRealmsSystem) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetJSMainRuntimeRealmsSystem(aJSMainRuntimeRealmsSystem); } \
506
  MOZ_MUST_USE NS_IMETHOD GetJSMainRuntimeRealmsUser(int64_t *aJSMainRuntimeRealmsUser) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetJSMainRuntimeRealmsUser(aJSMainRuntimeRealmsUser); } \
507
  MOZ_MUST_USE NS_IMETHOD GetImagesContentUsedUncompressed(int64_t *aImagesContentUsedUncompressed) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetImagesContentUsedUncompressed(aImagesContentUsedUncompressed); } \
508
  MOZ_MUST_USE NS_IMETHOD GetStorageSQLite(int64_t *aStorageSQLite) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStorageSQLite(aStorageSQLite); } \
509
  MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsVirtual(int64_t *aLowMemoryEventsVirtual) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLowMemoryEventsVirtual(aLowMemoryEventsVirtual); } \
510
  MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsCommitSpace(int64_t *aLowMemoryEventsCommitSpace) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLowMemoryEventsCommitSpace(aLowMemoryEventsCommitSpace); } \
511
  MOZ_MUST_USE NS_IMETHOD GetLowMemoryEventsPhysical(int64_t *aLowMemoryEventsPhysical) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLowMemoryEventsPhysical(aLowMemoryEventsPhysical); } \
512
  MOZ_MUST_USE NS_IMETHOD GetGhostWindows(int64_t *aGhostWindows) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetGhostWindows(aGhostWindows); } \
513
  MOZ_MUST_USE NS_IMETHOD GetPageFaultsHard(int64_t *aPageFaultsHard) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPageFaultsHard(aPageFaultsHard); } \
514
  NS_IMETHOD GetHasMozMallocUsableSize(bool *aHasMozMallocUsableSize) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHasMozMallocUsableSize(aHasMozMallocUsableSize); } \
515
  NS_IMETHOD GetIsDMDEnabled(bool *aIsDMDEnabled) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsDMDEnabled(aIsDMDEnabled); } \
516
  NS_IMETHOD GetIsDMDRunning(bool *aIsDMDRunning) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsDMDRunning(aIsDMDRunning); } \
517
  MOZ_MUST_USE NS_IMETHOD GetHeapAllocatedAsync(nsIHeapAllocatedCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHeapAllocatedAsync(callback); } \
518
  MOZ_MUST_USE NS_IMETHOD MinimizeMemoryUsage(nsIRunnable *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->MinimizeMemoryUsage(callback); } \
519
  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); } 
520
521
522
#include "js/TypeDecls.h"
523
#include "nsString.h"
524
#include "nsTArray.h"
525
class nsPIDOMWindowOuter;
526
namespace mozilla {
527
// All the following registration/unregistration functions don't use
528
// MOZ_MUST_USE because ignoring failures is common and reasonable.
529
// Register a memory reporter.  The manager service will hold a strong
530
// reference to this reporter.
531
XPCOM_API(nsresult) RegisterStrongMemoryReporter(nsIMemoryReporter* aReporter);
532
XPCOM_API(nsresult) RegisterStrongAsyncMemoryReporter(nsIMemoryReporter* aReporter);
533
// Register a memory reporter.  The manager service will hold a weak reference
534
// to this reporter.
535
XPCOM_API(nsresult) RegisterWeakMemoryReporter(nsIMemoryReporter* aReporter);
536
XPCOM_API(nsresult) RegisterWeakAsyncMemoryReporter(nsIMemoryReporter* aReporter);
537
// Unregister a strong memory reporter.
538
XPCOM_API(nsresult) UnregisterStrongMemoryReporter(nsIMemoryReporter* aReporter);
539
// Unregister a weak memory reporter.
540
XPCOM_API(nsresult) UnregisterWeakMemoryReporter(nsIMemoryReporter* aReporter);
541
// The memory reporter manager provides access to several distinguished
542
// amounts via attributes.  Some of these amounts are provided by Gecko
543
// components that cannot be accessed directly from XPCOM code.  So we provide
544
// the following functions for those components to be registered with the
545
// manager.
546
typedef int64_t (*InfallibleAmountFn)();
547
#define DECL_REGISTER_DISTINGUISHED_AMOUNT(kind, name) \
548
    nsresult Register##name##DistinguishedAmount(kind##AmountFn aAmountFn);
549
#define DECL_UNREGISTER_DISTINGUISHED_AMOUNT(name) \
550
    nsresult Unregister##name##DistinguishedAmount();
551
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, JSMainRuntimeGCHeap)
552
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, JSMainRuntimeTemporaryPeak)
553
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, JSMainRuntimeRealmsSystem)
554
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, JSMainRuntimeRealmsUser)
555
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, ImagesContentUsedUncompressed)
556
DECL_UNREGISTER_DISTINGUISHED_AMOUNT(ImagesContentUsedUncompressed)
557
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, StorageSQLite)
558
DECL_UNREGISTER_DISTINGUISHED_AMOUNT(StorageSQLite)
559
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, LowMemoryEventsVirtual)
560
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, LowMemoryEventsCommitSpace)
561
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, LowMemoryEventsPhysical)
562
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, GhostWindows)
563
#undef DECL_REGISTER_DISTINGUISHED_AMOUNT
564
#undef DECL_UNREGISTER_DISTINGUISHED_AMOUNT
565
// Likewise for per-tab measurement.
566
typedef MOZ_MUST_USE nsresult (*JSSizeOfTabFn)(JSObject* aObj,
567
                                               size_t* aJsObjectsSize,
568
                                               size_t* aJsStringSize,
569
                                               size_t* aJsPrivateSize,
570
                                               size_t* aJsOtherSize);
571
typedef MOZ_MUST_USE nsresult (*NonJSSizeOfTabFn)(nsPIDOMWindowOuter* aWindow,
572
                                                  size_t* aDomSize,
573
                                                  size_t* aStyleSize,
574
                                                  size_t* aOtherSize);
575
nsresult RegisterJSSizeOfTab(JSSizeOfTabFn aSizeOfTabFn);
576
nsresult RegisterNonJSSizeOfTab(NonJSSizeOfTabFn aSizeOfTabFn);
577
}
578
#if defined(MOZ_DMD)
579
#if !defined(MOZ_MEMORY)
580
#error "MOZ_DMD requires MOZ_MEMORY"
581
#endif
582
#include "DMD.h"
583
#define MOZ_REPORT(ptr)          mozilla::dmd::Report(ptr)
584
#define MOZ_REPORT_ON_ALLOC(ptr) mozilla::dmd::ReportOnAlloc(ptr)
585
#else
586
#define MOZ_REPORT(ptr)
587
#define MOZ_REPORT_ON_ALLOC(ptr)
588
#endif  // defined(MOZ_DMD)
589
// Functions generated via this macro should be used by all traversal-based
590
// memory reporters.  Such functions return |moz_malloc_size_of(ptr)|;  this
591
// will always be zero on some obscure platforms.
592
//
593
// You might be wondering why we have a macro that creates multiple functions
594
// that differ only in their name, instead of a single MallocSizeOf function.
595
// It's mostly to help with DMD integration, though it sometimes also helps
596
// with debugging and temporary ad hoc profiling.  The function name chosen
597
// doesn't matter greatly, but it's best to make it similar to the path used by
598
// the relevant memory reporter(s).
599
#define MOZ_DEFINE_MALLOC_SIZE_OF(fn)                                         \
600
  static size_t fn(const void* aPtr)                                          \
601
0
  {                                                                           \
602
0
      MOZ_REPORT(aPtr);                                                       \
603
0
      return moz_malloc_size_of(aPtr);                                        \
604
0
  }
Unexecuted instantiation: Unified_cpp_xpcom_base1.cpp:CycleCollectorMallocSizeOf(void const*)
Unexecuted instantiation: mozilla::URLPreloader::MallocSizeOf(void const*)
Unexecuted instantiation: nsMemoryReporterManager::MallocSizeOf(void const*)
Unexecuted instantiation: AtomTablesReporter::MallocSizeOf(void const*)
Unexecuted instantiation: ThreadsReporter::MallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_xpcom_components0.cpp:CategoryManagerMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_xpcom_components0.cpp:ComponentManagerMallocSizeOf(void const*)
Unexecuted instantiation: mozilla::ScriptPreloader::MallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_modules_libpref0.cpp:mozilla::PreferenceServiceMallocSizeOf(void const*)
Unexecuted instantiation: nsStringBundleBase::MallocSizeOf(void const*)
Unexecuted instantiation: nsStringBundleService::MallocSizeOf(void const*)
Unexecuted instantiation: nsCookieService.cpp:CookieServiceMallocSizeOf(void const*)
Unexecuted instantiation: nsEffectiveTLDService.cpp:EffectiveTLDServiceMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_netwerk_dns0.cpp:DNSServiceMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_netwerk_cache0.cpp:DiskCacheDeviceMallocSizeOf(void const*)
Unexecuted instantiation: mozilla::net::CacheStorageService::MallocSizeOf(void const*)
Unexecuted instantiation: mozilla::net::HpackStaticTableReporter::MallocSizeOf(void const*)
Unexecuted instantiation: mozilla::net::HpackDynamicTableReporter::MallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_js_xpconnect_src0.cpp:OrphanMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_js_xpconnect_src0.cpp:JSMallocSizeOf(void const*)
Unexecuted instantiation: mozilla::MediaStreamGraphImpl::MallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_gfx_thebes0.cpp:FontCacheMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_gfx_thebes1.cpp:FontListMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_gfx_thebes1.cpp:UserFontsMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_webrender_bindings0.cpp:mozilla::wr::WebRenderMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_image1.cpp:ImagesMallocSizeOf(void const*)
Unexecuted instantiation: nsContentUtils.cpp:(anonymous namespace)::DOMEventListenerManagersHashReporter::MallocSizeOf(void const*)
Unexecuted instantiation: mozilla::dom::AudioContext::MallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_dom_base2.cpp:ServoElementMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_dom_base4.cpp:ShadowRootAuthorStylesMallocSizeOf(void const*)
Unexecuted instantiation: mozilla::dom::StructuredCloneBlob::MallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_dom_base9.cpp:WindowsMallocSizeOf(void const*)
Unexecuted instantiation: mozilla::dom::WebIDLGlobalNamesHashReporter::MallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_dom_canvas4.cpp:mozilla::WebGLBufferMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_dom_canvas4.cpp:mozilla::WebGLShaderMallocSizeOf(void const*)
Unexecuted instantiation: mozilla::dom::StreamBlobImpl::MallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_dom_file0.cpp:mozilla::dom::MemoryFileDataOwnerMallocSizeOf(void const*)
Unexecuted instantiation: mozilla::dom::StringBlobImpl::MallocSizeOf(void const*)
Unexecuted instantiation: mozilla::MediaMemoryTracker::MallocSizeOf(void const*)
Unexecuted instantiation: mozilla::VideoQueueMemoryFunctor::MallocSizeOf(void const*)
Unexecuted instantiation: mozilla::AudioQueueMemoryFunctor::MallocSizeOf(void const*)
Unexecuted instantiation: mozilla::dom::MediaRecorderReporter::MallocSizeOf(void const*)
Unexecuted instantiation: mozilla::MediaEncoder::MallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_dom_media_webaudio0.cpp:mozilla::dom::AudioBufferMemoryTrackerMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_dom_workers1.cpp:mozilla::dom::JsWorkerMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_dom_xbl0.cpp:ServoAuthorStylesMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_dom_xul0.cpp:CacheMallocSizeOf(void const*)
Unexecuted instantiation: nsLayoutStylesheetCache.cpp:LayoutStylesheetCacheMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_layout_style1.cpp:mozilla::dom::ServoMediaListMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_layout_style2.cpp:GeckoSharedFontListMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_layout_style2.cpp:GeckoImageValueMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_layout_style2.cpp:GeckoURLValueMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_layout_style2.cpp:ServoStyleSetMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_layout_style2.cpp:ServoUACacheMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_layout_style2.cpp:mozilla::ServoStyleSheetMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_layout_base2.cpp:StyleSheetServiceMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_tools_profiler0.cpp:GeckoProfilerMallocSizeOf(void const*)
Unexecuted instantiation: mozilla::DataStorageMemoryReporter::MallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_components_places0.cpp:mozilla::places::HistoryMallocSizeOf(void const*)
Unexecuted instantiation: Telemetry.cpp:(anonymous namespace)::TelemetryMallocSizeOf(void const*)
Unexecuted instantiation: VariableLengthPrefixSet.cpp:mozilla::safebrowsing::UrlClassifierMallocSizeOf(void const*)
Unexecuted instantiation: nsUrlClassifierPrefixSet.cpp:UrlClassifierMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_startupcache0.cpp:mozilla::scache::StartupCacheMallocSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_xpcom_tests_gtest0.cpp:TestSizeOf(void const*)
Unexecuted instantiation: MemoryFunctor::MallocSizeOf(void const*)
605
// This is an alternative to MOZ_DEFINE_MALLOC_SIZE_OF that defines a
606
// MallocSizeOf function that can handle interior pointers.
607
#ifdef MOZ_MEMORY
608
#include "mozmemory.h"
609
#define MOZ_DEFINE_MALLOC_ENCLOSING_SIZE_OF(fn)                               \
610
  static size_t fn(const void* aPtr)                                          \
611
  {                                                                           \
612
      jemalloc_ptr_info_t info;                                               \
613
      jemalloc_ptr_info(aPtr, &info);                                         \
614
      MOZ_REPORT(info.addr);                                                  \
615
      return jemalloc_ptr_is_live(&info) ? info.size : 0;                     \
616
  }
617
#else
618
#define MOZ_DEFINE_MALLOC_ENCLOSING_SIZE_OF(fn)                               \
619
  static size_t fn(const void* aPtr)                                          \
620
0
  {                                                                           \
621
0
      return 0;                                                               \
622
0
  }
Unexecuted instantiation: Unified_cpp_dom_base2.cpp:ServoElementMallocEnclosingSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_dom_base4.cpp:ShadowRootAuthorStylesMallocEnclosingSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_dom_xbl0.cpp:ServoAuthorStylesMallocEnclosingSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_layout_style1.cpp:mozilla::ServoComputedValuesMallocEnclosingSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_layout_style1.cpp:mozilla::dom::ServoMediaListMallocEnclosingSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_layout_style2.cpp:ServoStyleStructsMallocEnclosingSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_layout_style2.cpp:ServoStyleSetMallocEnclosingSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_layout_style2.cpp:ServoUACacheMallocEnclosingSizeOf(void const*)
Unexecuted instantiation: Unified_cpp_layout_style2.cpp:mozilla::ServoStyleSheetMallocEnclosingSizeOf(void const*)
623
#endif
624
// Functions generated by the next two macros should be used by wrapping
625
// allocators that report heap blocks as soon as they are allocated and
626
// unreport them as soon as they are freed.  Such allocators are used in cases
627
// where we have third-party code that we cannot modify.  The two functions
628
// must always be used in tandem.
629
#define MOZ_DEFINE_MALLOC_SIZE_OF_ON_ALLOC(fn)                                \
630
  static size_t fn(const void* aPtr)                                          \
631
2.52k
  {                                                                           \
632
2.52k
      MOZ_REPORT_ON_ALLOC(aPtr);                                              \
633
2.52k
      return moz_malloc_size_of(aPtr);                                        \
634
2.52k
  }
mozilla::CountingAllocatorBase<ICUReporter>::MallocSizeOfOnAlloc(void const*)
Line
Count
Source
631
2.52k
  {                                                                           \
632
2.52k
      MOZ_REPORT_ON_ALLOC(aPtr);                                              \
633
2.52k
      return moz_malloc_size_of(aPtr);                                        \
634
2.52k
  }
Unexecuted instantiation: mozilla::CountingAllocatorBase<OggReporter>::MallocSizeOfOnAlloc(void const*)
Unexecuted instantiation: mozilla::layers::GfxMemoryImageReporter::MallocSizeOfOnAlloc(void const*)
Unexecuted instantiation: Unified_cpp_gfx_thebes1.cpp:UserFontMallocSizeOfOnAlloc(void const*)
Unexecuted instantiation: mozilla::CountingAllocatorBase<HunspellAllocator>::MallocSizeOfOnAlloc(void const*)
635
#define MOZ_DEFINE_MALLOC_SIZE_OF_ON_FREE(fn)                                 \
636
  static size_t fn(const void* aPtr)                                          \
637
2.47k
  {                                                                           \
638
2.47k
      return moz_malloc_size_of(aPtr);                                        \
639
2.47k
  }
mozilla::CountingAllocatorBase<ICUReporter>::MallocSizeOfOnFree(void const*)
Line
Count
Source
637
2.47k
  {                                                                           \
638
2.47k
      return moz_malloc_size_of(aPtr);                                        \
639
2.47k
  }
Unexecuted instantiation: mozilla::CountingAllocatorBase<OggReporter>::MallocSizeOfOnFree(void const*)
Unexecuted instantiation: mozilla::layers::GfxMemoryImageReporter::MallocSizeOfOnFree(void const*)
Unexecuted instantiation: mozilla::CountingAllocatorBase<HunspellAllocator>::MallocSizeOfOnFree(void const*)
640
// This macro assumes the presence of appropriate |aHandleReport| and |aData|
641
// variables. The (void) is there because we should always ignore the return
642
// value of the callback, because callback failures aren't fatal.
643
#define MOZ_COLLECT_REPORT(path, kind, units, amount, description)            \
644
0
  (void)aHandleReport->Callback(EmptyCString(), NS_LITERAL_CSTRING(path),     \
645
0
                                kind, units, amount,                          \
646
0
                                NS_LITERAL_CSTRING(description), aData)
647
648
#endif /* __gen_nsIMemoryReporter_h__ */