Bug 1293117 (part 5) - Change many NS_METHOD occurrences to NS_IMETHOD. r=froydnj.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 08 Aug 2016 10:54:50 +1000
changeset 309107 2605dceca7b26e11f3a2c546cf5aaea7d0fb9385
parent 309106 babe907f527681f351d62d689230d23e55d6a729
child 309108 05133363f4edf4633ce9ee0dff1ce31f56908c9d
push id30557
push userkwierso@gmail.com
push dateFri, 12 Aug 2016 20:45:15 +0000
treeherdermozilla-central@ef3a50774180 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1293117
milestone51.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 1293117 (part 5) - Change many NS_METHOD occurrences to NS_IMETHOD. r=froydnj. This patch makes the following changes on many in-class methods. - NS_METHOD F() override; --> NS_IMETHOD F() override; - NS_METHOD F() override {...} --> NS_IMETHOD F() override {...} - NS_METHOD F() final; --> NS_IMETHOD F() final; - NS_METHOD F() final {...} --> NS_IMETHOD F() final {...} Using NS_IMETHOD is the preferred way of marking in-class virtual methods. Although these transformations add an explicit |virtual|, they are safe -- there's an implicit |virtual| anyway because |override| and |final| only work with virtual methods.
dom/bluetooth/bluedroid/BluetoothAvrcpManager.cpp
dom/media/MediaRecorder.cpp
layout/generic/nsPluginFrame.h
toolkit/components/osfile/NativeOSFileInternals.cpp
toolkit/crashreporter/nsExceptionHandler.cpp
widget/nsDeviceContextSpecProxy.h
xpcom/base/nsMemoryReporterManager.cpp
xpcom/threads/TaskQueue.h
--- a/dom/bluetooth/bluedroid/BluetoothAvrcpManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothAvrcpManager.cpp
@@ -437,17 +437,17 @@ BluetoothAvrcpManager::HandleShutdown()
 class BluetoothAvrcpManager::ConnectRunnable final : public Runnable
 {
 public:
   ConnectRunnable(BluetoothAvrcpManager* aManager)
     : mManager(aManager)
   {
     MOZ_ASSERT(mManager);
   }
-  NS_METHOD Run() override
+  NS_IMETHOD Run() override
   {
     mManager->OnConnect(EmptyString());
     return NS_OK;
   }
 private:
   BluetoothAvrcpManager* mManager;
 };
 
@@ -470,17 +470,17 @@ BluetoothAvrcpManager::Connect(const Blu
 class BluetoothAvrcpManager::DisconnectRunnable final : public Runnable
 {
 public:
   DisconnectRunnable(BluetoothAvrcpManager* aManager)
     : mManager(aManager)
   {
     MOZ_ASSERT(mManager);
   }
-  NS_METHOD Run() override
+  NS_IMETHOD Run() override
   {
     mManager->OnDisconnect(EmptyString());
     return NS_OK;
   }
 private:
   BluetoothAvrcpManager* mManager;
 };
 
--- a/dom/media/MediaRecorder.cpp
+++ b/dom/media/MediaRecorder.cpp
@@ -68,17 +68,17 @@ public:
   {
     RecordersArray& recorders = GetRecorders();
     recorders.RemoveElement(aRecorder);
     if (recorders.IsEmpty()) {
       sUniqueInstance = nullptr;
     }
   }
 
-  NS_METHOD
+  NS_IMETHOD
   CollectReports(nsIHandleReportCallback* aHandleReport,
                  nsISupports* aData, bool aAnonymize) override
   {
     int64_t amount = 0;
     RecordersArray& recorders = GetRecorders();
     for (size_t i = 0; i < recorders.Length(); ++i) {
       amount += recorders[i]->SizeOfExcludingThis(MallocSizeOf);
     }
--- a/layout/generic/nsPluginFrame.h
+++ b/layout/generic/nsPluginFrame.h
@@ -100,17 +100,17 @@ public:
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const override;
 #endif
 
   virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
 
   virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) override;
 
-  NS_METHOD GetPluginInstance(nsNPAPIPluginInstance** aPluginInstance) override;
+  NS_IMETHOD GetPluginInstance(nsNPAPIPluginInstance** aPluginInstance) override;
 
   virtual void SetIsDocumentActive(bool aIsActive) override;
 
   virtual nsresult GetCursor(const nsPoint& aPoint, 
                              nsIFrame::Cursor& aCursor) override;
 
   // APIs used by nsRootPresContext to set up the widget position/size/clip
   // region.
--- a/toolkit/components/osfile/NativeOSFileInternals.cpp
+++ b/toolkit/components/osfile/NativeOSFileInternals.cpp
@@ -589,17 +589,17 @@ public:
                     nsMainThreadPtrHandle<nsINativeOSFileErrorCallback>& aOnError)
     : AbstractDoEvent(aOnSuccess, aOnError)
     , mPath(aPath)
     , mBytes(aBytes)
   {
     MOZ_ASSERT(NS_IsMainThread());
   }
 
-  NS_METHOD Run() override {
+  NS_IMETHOD Run() override {
     MOZ_ASSERT(!NS_IsMainThread());
     TimeStamp dispatchDate = TimeStamp::Now();
 
     nsresult rv = BeforeRead();
     if (NS_FAILED(rv)) {
       // Error reporting is handled by BeforeRead();
       return NS_OK;
     }
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -2121,17 +2121,17 @@ public:
     , mAppendAppNotes(false)
     {}
   explicit CrashReporterHelperRunnable(const nsACString& aData)
     : mKey()
     , mData(aData)
     , mAppendAppNotes(true)
     {}
 
-  NS_METHOD Run() override;
+  NS_IMETHOD Run() override;
 
 private:
   nsCString mKey;
   nsCString mData;
   bool mAppendAppNotes;
 };
 
 nsresult AnnotateCrashReport(const nsACString& key, const nsACString& data)
--- a/widget/nsDeviceContextSpecProxy.h
+++ b/widget/nsDeviceContextSpecProxy.h
@@ -22,38 +22,38 @@ class RemotePrintJobChild;
 }
 }
 
 class nsDeviceContextSpecProxy final : public nsIDeviceContextSpec
 {
 public:
   NS_DECL_ISUPPORTS
 
-  NS_METHOD Init(nsIWidget* aWidget, nsIPrintSettings* aPrintSettings,
+  NS_IMETHOD Init(nsIWidget* aWidget, nsIPrintSettings* aPrintSettings,
                  bool aIsPrintPreview) final;
 
   virtual already_AddRefed<PrintTarget> MakePrintTarget() final;
 
-  NS_METHOD GetDrawEventRecorder(mozilla::gfx::DrawEventRecorder** aDrawEventRecorder) final;
+  NS_IMETHOD GetDrawEventRecorder(mozilla::gfx::DrawEventRecorder** aDrawEventRecorder) final;
 
   float GetDPI() final;
 
   float GetPrintingScale() final;
 
-  NS_METHOD BeginDocument(const nsAString& aTitle,
-                          const nsAString& aPrintToFileName,
-                          int32_t aStartPage, int32_t aEndPage) final;
+  NS_IMETHOD BeginDocument(const nsAString& aTitle,
+                           const nsAString& aPrintToFileName,
+                           int32_t aStartPage, int32_t aEndPage) final;
 
-  NS_METHOD EndDocument() final;
+  NS_IMETHOD EndDocument() final;
 
-  NS_METHOD AbortDocument() final;
+  NS_IMETHOD AbortDocument() final;
 
-  NS_METHOD BeginPage() final;
+  NS_IMETHOD BeginPage() final;
 
-  NS_METHOD EndPage() final;
+  NS_IMETHOD EndPage() final;
 
 private:
   ~nsDeviceContextSpecProxy() {}
 
   nsCOMPtr<nsIPrintSettings> mPrintSettings;
   nsCOMPtr<nsIPrintSession> mPrintSession;
   nsCOMPtr<nsIDeviceContextSpec> mRealDeviceContextSpec;
   RefPtr<mozilla::layout::RemotePrintJobChild> mRemotePrintJob;
--- a/xpcom/base/nsMemoryReporterManager.cpp
+++ b/xpcom/base/nsMemoryReporterManager.cpp
@@ -799,18 +799,18 @@ struct SegmentEntry : public PLDHashEntr
 
 class WindowsAddressSpaceReporter final : public nsIMemoryReporter
 {
   ~WindowsAddressSpaceReporter() {}
 
 public:
   NS_DECL_ISUPPORTS
 
-  NS_METHOD CollectReports(nsIHandleReportCallback* aHandleReport,
-                           nsISupports* aData, bool aAnonymize) override
+  NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
+                            nsISupports* aData, bool aAnonymize) override
   {
     // First iterate over all the segments and record how many of each kind
     // there were and their aggregate sizes. We use a hash table for this
     // because there are a couple of dozen different kinds possible.
 
     PLDHashTable table(&SegmentEntry::Ops, sizeof(SegmentEntry));
     MEMORY_BASIC_INFORMATION info = { 0 };
     bool isPrevSegStackGuard = false;
@@ -982,18 +982,18 @@ NS_IMPL_ISUPPORTS(WindowsAddressSpaceRep
 #ifdef HAVE_VSIZE_MAX_CONTIGUOUS_REPORTER
 class VsizeMaxContiguousReporter final : public nsIMemoryReporter
 {
   ~VsizeMaxContiguousReporter() {}
 
 public:
   NS_DECL_ISUPPORTS
 
-  NS_METHOD CollectReports(nsIHandleReportCallback* aHandleReport,
-                           nsISupports* aData, bool aAnonymize) override
+  NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
+                            nsISupports* aData, bool aAnonymize) override
   {
     int64_t amount;
     nsresult rv = VsizeMaxContiguousDistinguishedAmount(&amount);
     NS_ENSURE_SUCCESS(rv, rv);
     return MOZ_COLLECT_REPORT(
       "vsize-max-contiguous", KIND_OTHER, UNITS_BYTES, amount,
       "Size of the maximum contiguous block of available virtual "
       "memory.");
@@ -1005,18 +1005,18 @@ NS_IMPL_ISUPPORTS(VsizeMaxContiguousRepo
 #ifdef HAVE_PRIVATE_REPORTER
 class PrivateReporter final : public nsIMemoryReporter
 {
   ~PrivateReporter() {}
 
 public:
   NS_DECL_ISUPPORTS
 
-  NS_METHOD CollectReports(nsIHandleReportCallback* aHandleReport,
-                           nsISupports* aData, bool aAnonymize) override
+  NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
+                            nsISupports* aData, bool aAnonymize) override
   {
     int64_t amount;
     nsresult rv = PrivateDistinguishedAmount(&amount);
     NS_ENSURE_SUCCESS(rv, rv);
     return MOZ_COLLECT_REPORT(
       "private", KIND_OTHER, UNITS_BYTES, amount,
 "Memory that cannot be shared with other processes, including memory that is "
 "committed and marked MEM_PRIVATE, data that is not mapped, and executable "
@@ -1029,18 +1029,18 @@ NS_IMPL_ISUPPORTS(PrivateReporter, nsIMe
 #ifdef HAVE_VSIZE_AND_RESIDENT_REPORTERS
 class VsizeReporter final : public nsIMemoryReporter
 {
   ~VsizeReporter() {}
 
 public:
   NS_DECL_ISUPPORTS
 
-  NS_METHOD CollectReports(nsIHandleReportCallback* aHandleReport,
-                           nsISupports* aData, bool aAnonymize) override
+  NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
+                            nsISupports* aData, bool aAnonymize) override
   {
     int64_t amount;
     nsresult rv = VsizeDistinguishedAmount(&amount);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return MOZ_COLLECT_REPORT(
       "vsize", KIND_OTHER, UNITS_BYTES, amount,
 "Memory mapped by the process, including code and data segments, the heap, "
@@ -1056,18 +1056,18 @@ NS_IMPL_ISUPPORTS(VsizeReporter, nsIMemo
 
 class ResidentReporter final : public nsIMemoryReporter
 {
   ~ResidentReporter() {}
 
 public:
   NS_DECL_ISUPPORTS
 
-  NS_METHOD CollectReports(nsIHandleReportCallback* aHandleReport,
-                           nsISupports* aData, bool aAnonymize) override
+  NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
+                            nsISupports* aData, bool aAnonymize) override
   {
     int64_t amount;
     nsresult rv = ResidentDistinguishedAmount(&amount);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return MOZ_COLLECT_REPORT(
       "resident", KIND_OTHER, UNITS_BYTES, amount,
 "Memory mapped by the process that is present in physical memory, also known "
@@ -1085,18 +1085,18 @@ NS_IMPL_ISUPPORTS(ResidentReporter, nsIM
 #ifdef HAVE_RESIDENT_UNIQUE_REPORTER
 class ResidentUniqueReporter final : public nsIMemoryReporter
 {
   ~ResidentUniqueReporter() {}
 
 public:
   NS_DECL_ISUPPORTS
 
-  NS_METHOD CollectReports(nsIHandleReportCallback* aHandleReport,
-                           nsISupports* aData, bool aAnonymize) override
+  NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
+                            nsISupports* aData, bool aAnonymize) override
   {
     int64_t amount = 0;
     nsresult rv = ResidentUniqueDistinguishedAmount(&amount);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return MOZ_COLLECT_REPORT(
       "resident-unique", KIND_OTHER, UNITS_BYTES, amount,
 "Memory mapped by the process that is present in physical memory and not "
@@ -1113,18 +1113,18 @@ NS_IMPL_ISUPPORTS(ResidentUniqueReporter
 
 class SystemHeapReporter final : public nsIMemoryReporter
 {
   ~SystemHeapReporter() {}
 
 public:
   NS_DECL_ISUPPORTS
 
-  NS_METHOD CollectReports(nsIHandleReportCallback* aHandleReport,
-                           nsISupports* aData, bool aAnonymize) override
+  NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
+                            nsISupports* aData, bool aAnonymize) override
   {
     int64_t amount;
     nsresult rv = SystemHeapSize(&amount);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return MOZ_COLLECT_REPORT(
       "system-heap-allocated", KIND_OTHER, UNITS_BYTES, amount,
 "Memory used by the system allocator that is currently allocated to the "
@@ -1169,18 +1169,18 @@ ResidentPeakDistinguishedAmount(int64_t*
 
 class ResidentPeakReporter final : public nsIMemoryReporter
 {
   ~ResidentPeakReporter() {}
 
 public:
   NS_DECL_ISUPPORTS
 
-  NS_METHOD CollectReports(nsIHandleReportCallback* aHandleReport,
-                           nsISupports* aData, bool aAnonymize) override
+  NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
+                            nsISupports* aData, bool aAnonymize) override
   {
     int64_t amount = 0;
     nsresult rv = ResidentPeakDistinguishedAmount(&amount);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return MOZ_COLLECT_REPORT(
       "resident-peak", KIND_OTHER, UNITS_BYTES, amount,
 "The peak 'resident' value for the lifetime of the process.");
@@ -1192,18 +1192,18 @@ NS_IMPL_ISUPPORTS(ResidentPeakReporter, 
 
 class PageFaultsSoftReporter final : public nsIMemoryReporter
 {
   ~PageFaultsSoftReporter() {}
 
 public:
   NS_DECL_ISUPPORTS
 
-  NS_METHOD CollectReports(nsIHandleReportCallback* aHandleReport,
-                           nsISupports* aData, bool aAnonymize) override
+  NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
+                            nsISupports* aData, bool aAnonymize) override
   {
     struct rusage usage;
     int err = getrusage(RUSAGE_SELF, &usage);
     if (err != 0) {
       return NS_ERROR_FAILURE;
     }
     int64_t amount = usage.ru_minflt;
 
@@ -1236,18 +1236,18 @@ PageFaultsHardDistinguishedAmount(int64_
 
 class PageFaultsHardReporter final : public nsIMemoryReporter
 {
   ~PageFaultsHardReporter() {}
 
 public:
   NS_DECL_ISUPPORTS
 
-  NS_METHOD CollectReports(nsIHandleReportCallback* aHandleReport,
-                           nsISupports* aData, bool aAnonymize) override
+  NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
+                            nsISupports* aData, bool aAnonymize) override
   {
     int64_t amount = 0;
     nsresult rv = PageFaultsHardDistinguishedAmount(&amount);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return MOZ_COLLECT_REPORT(
       "page-faults-hard", KIND_OTHER, UNITS_COUNT_CUMULATIVE, amount,
 "The number of hard page faults (also known as 'major page faults') that have "
@@ -1293,18 +1293,18 @@ HeapOverheadFraction(jemalloc_stats_t* a
 
 class JemallocHeapReporter final : public nsIMemoryReporter
 {
   ~JemallocHeapReporter() {}
 
 public:
   NS_DECL_ISUPPORTS
 
-  NS_METHOD CollectReports(nsIHandleReportCallback* aHandleReport,
-                           nsISupports* aData, bool aAnonymize) override
+  NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
+                            nsISupports* aData, bool aAnonymize) override
   {
     jemalloc_stats_t stats;
     jemalloc_stats(&stats);
 
     nsresult rv;
 
     rv = MOZ_COLLECT_REPORT(
       "heap-committed/allocated", KIND_OTHER, UNITS_BYTES, stats.allocated,
@@ -1387,18 +1387,18 @@ class AtomTablesReporter final : public 
 {
   MOZ_DEFINE_MALLOC_SIZE_OF(MallocSizeOf)
 
   ~AtomTablesReporter() {}
 
 public:
   NS_DECL_ISUPPORTS
 
-  NS_METHOD CollectReports(nsIHandleReportCallback* aHandleReport,
-                           nsISupports* aData, bool aAnonymize) override
+  NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
+                            nsISupports* aData, bool aAnonymize) override
   {
     size_t Main, Static;
     NS_SizeOfAtomTablesIncludingThis(MallocSizeOf, &Main, &Static);
 
     nsresult rv;
     rv = MOZ_COLLECT_REPORT(
       "explicit/atom-tables/main", KIND_HEAP, UNITS_BYTES, Main,
       "Memory used by the main atoms table.");
@@ -1424,18 +1424,18 @@ class DeadlockDetectorReporter final : p
 {
   MOZ_DEFINE_MALLOC_SIZE_OF(MallocSizeOf)
 
   ~DeadlockDetectorReporter() {}
 
 public:
   NS_DECL_ISUPPORTS
 
-  NS_METHOD CollectReports(nsIHandleReportCallback* aHandleReport,
-                           nsISupports* aData, bool aAnonymize) override
+  NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
+                            nsISupports* aData, bool aAnonymize) override
   {
     return MOZ_COLLECT_REPORT(
       "explicit/deadlock-detector", KIND_HEAP, UNITS_BYTES,
       BlockingResourceBase::SizeOfDeadlockDetector(MallocSizeOf),
       "Memory used by the deadlock detector.");
   }
 };
 NS_IMPL_ISUPPORTS(DeadlockDetectorReporter, nsIMemoryReporter)
--- a/xpcom/threads/TaskQueue.h
+++ b/xpcom/threads/TaskQueue.h
@@ -168,17 +168,17 @@ protected:
   bool mIsFlushing;
 
   class Runner : public Runnable {
   public:
     explicit Runner(TaskQueue* aQueue)
       : mQueue(aQueue)
     {
     }
-    NS_METHOD Run() override;
+    NS_IMETHOD Run() override;
   private:
     RefPtr<TaskQueue> mQueue;
   };
 };
 
 } // namespace mozilla
 
 #endif // TaskQueue_h_