From 8f51d02c976b7e679c6f17f7b3cd82719cd178cc Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 8 Aug 2016 10:54:50 +1000 Subject: [PATCH] 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. --HG-- extra : rebase_source : 3010fade82a170eab7f13d81bf61b02cd693f3cf --- .../bluedroid/BluetoothAvrcpManager.cpp | 4 +- dom/media/MediaRecorder.cpp | 2 +- layout/generic/nsPluginFrame.h | 2 +- .../osfile/NativeOSFileInternals.cpp | 2 +- toolkit/crashreporter/nsExceptionHandler.cpp | 2 +- widget/nsDeviceContextSpecProxy.h | 18 +++---- xpcom/base/nsMemoryReporterManager.cpp | 52 +++++++++---------- xpcom/threads/TaskQueue.h | 2 +- 8 files changed, 42 insertions(+), 42 deletions(-) diff --git a/dom/bluetooth/bluedroid/BluetoothAvrcpManager.cpp b/dom/bluetooth/bluedroid/BluetoothAvrcpManager.cpp index cca192d74365..082247e6bd11 100644 --- a/dom/bluetooth/bluedroid/BluetoothAvrcpManager.cpp +++ b/dom/bluetooth/bluedroid/BluetoothAvrcpManager.cpp @@ -442,7 +442,7 @@ public: { MOZ_ASSERT(mManager); } - NS_METHOD Run() override + NS_IMETHOD Run() override { mManager->OnConnect(EmptyString()); return NS_OK; @@ -475,7 +475,7 @@ public: { MOZ_ASSERT(mManager); } - NS_METHOD Run() override + NS_IMETHOD Run() override { mManager->OnDisconnect(EmptyString()); return NS_OK; diff --git a/dom/media/MediaRecorder.cpp b/dom/media/MediaRecorder.cpp index dc82bb3112c4..b029245499b9 100644 --- a/dom/media/MediaRecorder.cpp +++ b/dom/media/MediaRecorder.cpp @@ -73,7 +73,7 @@ public: } } - NS_METHOD + NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport, nsISupports* aData, bool aAnonymize) override { diff --git a/layout/generic/nsPluginFrame.h b/layout/generic/nsPluginFrame.h index 92509c95b593..2da863ab1f05 100644 --- a/layout/generic/nsPluginFrame.h +++ b/layout/generic/nsPluginFrame.h @@ -105,7 +105,7 @@ public: virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) override; - NS_METHOD GetPluginInstance(nsNPAPIPluginInstance** aPluginInstance) override; + NS_IMETHOD GetPluginInstance(nsNPAPIPluginInstance** aPluginInstance) override; virtual void SetIsDocumentActive(bool aIsActive) override; diff --git a/toolkit/components/osfile/NativeOSFileInternals.cpp b/toolkit/components/osfile/NativeOSFileInternals.cpp index c3317bddc6c2..e4725d390de9 100644 --- a/toolkit/components/osfile/NativeOSFileInternals.cpp +++ b/toolkit/components/osfile/NativeOSFileInternals.cpp @@ -594,7 +594,7 @@ public: MOZ_ASSERT(NS_IsMainThread()); } - NS_METHOD Run() override { + NS_IMETHOD Run() override { MOZ_ASSERT(!NS_IsMainThread()); TimeStamp dispatchDate = TimeStamp::Now(); diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp index a41928d22473..f1f801dca61f 100644 --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -2126,7 +2126,7 @@ public: , mAppendAppNotes(true) {} - NS_METHOD Run() override; + NS_IMETHOD Run() override; private: nsCString mKey; diff --git a/widget/nsDeviceContextSpecProxy.h b/widget/nsDeviceContextSpecProxy.h index 6997c80a3da2..aea5f985fbc0 100644 --- a/widget/nsDeviceContextSpecProxy.h +++ b/widget/nsDeviceContextSpecProxy.h @@ -27,28 +27,28 @@ 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 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() {} diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index 0079976dbc19..9fc85ebc44e6 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -804,8 +804,8 @@ class WindowsAddressSpaceReporter final : public nsIMemoryReporter 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 @@ -987,8 +987,8 @@ class VsizeMaxContiguousReporter final : public nsIMemoryReporter 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); @@ -1010,8 +1010,8 @@ class PrivateReporter final : public nsIMemoryReporter 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); @@ -1034,8 +1034,8 @@ class VsizeReporter final : public nsIMemoryReporter 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); @@ -1061,8 +1061,8 @@ class ResidentReporter final : public nsIMemoryReporter 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); @@ -1090,8 +1090,8 @@ class ResidentUniqueReporter final : public nsIMemoryReporter 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); @@ -1118,8 +1118,8 @@ class SystemHeapReporter final : public nsIMemoryReporter 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); @@ -1174,8 +1174,8 @@ class ResidentPeakReporter final : public nsIMemoryReporter 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); @@ -1197,8 +1197,8 @@ class PageFaultsSoftReporter final : public nsIMemoryReporter 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); @@ -1241,8 +1241,8 @@ class PageFaultsHardReporter final : public nsIMemoryReporter 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); @@ -1298,8 +1298,8 @@ class JemallocHeapReporter final : public nsIMemoryReporter 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); @@ -1392,8 +1392,8 @@ class AtomTablesReporter final : public nsIMemoryReporter 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); @@ -1429,8 +1429,8 @@ class DeadlockDetectorReporter final : public nsIMemoryReporter 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, diff --git a/xpcom/threads/TaskQueue.h b/xpcom/threads/TaskQueue.h index 6f40cfe3fcfa..19f5c942d2eb 100644 --- a/xpcom/threads/TaskQueue.h +++ b/xpcom/threads/TaskQueue.h @@ -173,7 +173,7 @@ protected: : mQueue(aQueue) { } - NS_METHOD Run() override; + NS_IMETHOD Run() override; private: RefPtr mQueue; };