Bug 1401100 - Remove nsIMemoryReporterCallback. r=erahm.
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 22 Sep 2017 08:09:29 +1000
changeset 433124 8871efefdba925fd4fa7e8741cb545dd64131271
parent 433123 c86578718e191af2dac78dfde75b002448ea80ec
child 433125 976a82102f131f232cca5e88d1746fb63226c3f9
push id8114
push userjlorenzo@mozilla.com
push dateThu, 02 Nov 2017 16:33:21 +0000
treeherdermozilla-beta@73e0d89a540f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerserahm
bugs1401100
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1401100 - Remove nsIMemoryReporterCallback. r=erahm. nsIHandleReportCallback, typedef of nsIMemoryReporterCallback, has been the preferred name for a long time and is used in most places. This patch removes nsIMemoryReporterCallback.
js/xpconnect/src/XPCJSMemoryReporter.h
js/xpconnect/src/xpcpublic.h
toolkit/components/aboutmemory/tests/test_memoryReporters.xul
xpcom/base/nsIMemoryReporter.idl
--- a/js/xpconnect/src/XPCJSMemoryReporter.h
+++ b/js/xpconnect/src/XPCJSMemoryReporter.h
@@ -3,31 +3,31 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef XPCJSMemoryReporter_h
 #define XPCJSMemoryReporter_h
 
 class nsISupports;
-class nsIMemoryReporterCallback;
+class nsIHandleReportCallback;
 
 namespace xpc {
 
 // The key is the window ID.
 typedef nsDataHashtable<nsUint64HashKey, nsCString> WindowPaths;
 
 // This is very nearly an instance of nsIMemoryReporter, but it's not,
 // because it's invoked by nsWindowMemoryReporter in order to get |windowPaths|
 // in CollectReports.
 class JSReporter
 {
 public:
     static void CollectReports(WindowPaths* windowPaths,
                                WindowPaths* topWindowPaths,
-                               nsIMemoryReporterCallback* handleReport,
+                               nsIHandleReportCallback* handleReport,
                                nsISupports* data,
                                bool anonymize);
 };
 
 } // namespace xpc
 
 #endif
--- a/js/xpconnect/src/xpcpublic.h
+++ b/js/xpconnect/src/xpcpublic.h
@@ -25,17 +25,17 @@
 #include "nsMathUtils.h"
 #include "nsStringBuffer.h"
 #include "mozilla/dom/BindingDeclarations.h"
 #include "mozilla/Preferences.h"
 
 class nsGlobalWindow;
 class nsIPrincipal;
 class nsScriptNameSpaceManager;
-class nsIMemoryReporterCallback;
+class nsIHandleReportCallback;
 
 namespace mozilla {
 namespace dom {
 class Exception;
 }
 }
 
 typedef void (* xpcGCCallback)(JSGCStatus status);
@@ -426,17 +426,17 @@ private:
 
 // This reports all the stats in |rtStats| that belong in the "explicit" tree,
 // (which isn't all of them).
 // @see ZoneStatsExtras
 // @see CompartmentStatsExtras
 void
 ReportJSRuntimeExplicitTreeStats(const JS::RuntimeStats& rtStats,
                                  const nsACString& rtPath,
-                                 nsIMemoryReporterCallback* handleReport,
+                                 nsIHandleReportCallback* handleReport,
                                  nsISupports* data,
                                  bool anonymize,
                                  size_t* rtTotal = nullptr);
 
 /**
  * Throws an exception on cx and returns false.
  */
 bool
--- a/toolkit/components/aboutmemory/tests/test_memoryReporters.xul
+++ b/toolkit/components/aboutmemory/tests/test_memoryReporters.xul
@@ -335,17 +335,17 @@
             "Test " + path + ".",
             data);
         }
         catch (ex) {
           ok(false, ex);
         }
       }
     },
-    // nsIMemoryReporterCallback
+    // nsIHandleReportCallback
     callback: function(process, path, kind, units, amount, data) {
       if (path in this.tests) {
         this.seen++;
         let test = this.tests[path];
         ok(units === test.units, "Test reporter units match");
         ok(amount === (test.expected || test.amount)(),
            "Test reporter values match: " + amount);
       }
--- a/xpcom/base/nsIMemoryReporter.idl
+++ b/xpcom/base/nsIMemoryReporter.idl
@@ -17,17 +17,17 @@ interface nsISimpleEnumerator;
 /*
  * Memory reporters measure Firefox's memory usage.  They are primarily used to
  * generate the about:memory page.  You should read
  * https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Memory_reporting
  * before writing a memory reporter.
  */
 
 [scriptable, function, uuid(62ef0e1c-dbd6-11e3-aa75-3c970e9f4238)]
-interface nsIMemoryReporterCallback : nsISupports
+interface nsIHandleReportCallback : nsISupports
 {
   /*
    * The arguments to the callback are as follows.
    *
    *
    * |process|  The name of the process containing this reporter.  Each
    * reporter initially has "" in this field, indicating that it applies to the
    * current process.  (This is true even for reporters in a child process.)
@@ -174,29 +174,29 @@ interface nsIMemoryReporter : nsISupport
    * In short, anything that could identify parts of the user's browsing
    * history is considered privacy-sensitive.
    *
    * The following thing are not considered privacy-sensitive.
    *
    * - Chrome domains and URLs.
    * - Information about installed extensions.
    */
-  void collectReports(in nsIMemoryReporterCallback callback,
+  void collectReports(in nsIHandleReportCallback callback,
                       in nsISupports data,
                       in boolean anonymize);
 
   /*
-   * Kinds. See the |kind| comment in nsIMemoryReporterCallback.
+   * Kinds. See the |kind| comment in nsIHandleReportCallback.
    */
   const int32_t KIND_NONHEAP = 0;
   const int32_t KIND_HEAP    = 1;
   const int32_t KIND_OTHER   = 2;
 
   /*
-   * Units. See the |units| comment in nsIMemoryReporterCallback.
+   * Units. See the |units| comment in nsIHandleReportCallback.
    */
   const int32_t UNITS_BYTES = 0;
   const int32_t UNITS_COUNT = 1;
   const int32_t UNITS_COUNT_CUMULATIVE = 2;
   const int32_t UNITS_PERCENTAGE = 3;
 };
 
 [scriptable, function, uuid(548b3909-c04d-4ca6-8466-b8bee3837457)]
@@ -270,44 +270,44 @@ interface nsIMemoryReporterManager : nsI
    * previous getReports() call is still in flight, i.e. if it has not yet
    * finished invoking |finishReporting|.  The silent abort is because the
    * in-flight request will finish soon, and the caller would very likely just
    * catch and ignore any error anyway.
    *
    * If |anonymize| is true, it indicates that the memory reporters should
    * anonymize any privacy-sensitive data (see above).
    */
-  void getReports(in nsIMemoryReporterCallback handleReport,
+  void getReports(in nsIHandleReportCallback handleReport,
                   in nsISupports handleReportData,
                   in nsIFinishReportingCallback finishReporting,
                   in nsISupports finishReportingData,
                   in boolean anonymize);
 
   /*
    * As above, but: If |minimizeMemoryUsage| is true, then each process will
    * minimize its memory usage (see the |minimizeMemoryUsage| method) before
    * gathering its report.  If DMD is enabled and |DMDDumpIdent| is non-empty
    * then write a DMD report to a file in the usual temporary directory (see
    * |dumpMemoryInfoToTempDir| in |nsIMemoryInfoDumper|.)
    */
   [noscript] void
-    getReportsExtended(in nsIMemoryReporterCallback handleReport,
+    getReportsExtended(in nsIHandleReportCallback handleReport,
                        in nsISupports handleReportData,
                        in nsIFinishReportingCallback finishReporting,
                        in nsISupports finishReportingData,
                        in boolean anonymize,
                        in boolean minimizeMemoryUsage,
                        in AString DMDDumpIdent);
 
   /*
    * As above, but if DMD is enabled and |DMDFile| is non-null then
    * write a DMD report to that file and close it.
    */
   [noscript] void
-    getReportsForThisProcessExtended(in nsIMemoryReporterCallback handleReport,
+    getReportsForThisProcessExtended(in nsIHandleReportCallback handleReport,
                                      in nsISupports handleReportData,
                                      in boolean anonymize,
                                      in FILE DMDFile,
                                      in nsIFinishReportingCallback finishReporting,
                                      in nsISupports finishReportingData);
 
   /*
    * Called by an asynchronous memory reporter upon completion.
@@ -453,20 +453,16 @@ interface nsIMemoryReporterManager : nsI
 %{C++
 
 #include "js/TypeDecls.h"
 #include "nsStringGlue.h"
 #include "nsTArray.h"
 
 class nsPIDOMWindowOuter;
 
-// nsIHandleReportCallback is a better name, but keep nsIMemoryReporterCallback
-// around for backwards compatibility.
-typedef nsIMemoryReporterCallback nsIHandleReportCallback;
-
 namespace mozilla {
 
 // All the following registration/unregistration functions don't use
 // MOZ_MUST_USE because ignoring failures is common and reasonable.
 
 // Register a memory reporter.  The manager service will hold a strong
 // reference to this reporter.
 XPCOM_API(nsresult) RegisterStrongMemoryReporter(nsIMemoryReporter* aReporter);