From 6ea5fa1b4f07b3166e6a53f4fe246bd303639e5e Mon Sep 17 00:00:00 2001 From: Peter Van der Beken Date: Fri, 23 Nov 2018 15:14:23 +0000 Subject: [PATCH] Bug 1507604 - Remove unused GetSerial methods. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D12137 --HG-- extra : moz-landing-system : lando --- dom/base/nsGlobalWindowInner.cpp | 8 +++++--- dom/base/nsGlobalWindowInner.h | 10 ++++------ dom/base/nsGlobalWindowOuter.cpp | 4 ++-- dom/base/nsGlobalWindowOuter.h | 6 +----- dom/base/nsPIDOMWindow.h | 14 -------------- 5 files changed, 12 insertions(+), 30 deletions(-) diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp index 37479e5da2bc..9bcb4e33d9ab 100644 --- a/dom/base/nsGlobalWindowInner.cpp +++ b/dom/base/nsGlobalWindowInner.cpp @@ -918,8 +918,10 @@ nsGlobalWindowInner::nsGlobalWindowInner(nsGlobalWindowOuter *aOuterWindow) mHasSeenGamepadInput(false), mSuspendDepth(0), mFreezeDepth(0), - mFocusMethod(0), +#ifdef DEBUG mSerial(0), +#endif + mFocusMethod(0), mIdleRequestCallbackCounter(1), mIdleRequestExecutor(nullptr), mDialogAbuseCount(0), @@ -977,8 +979,6 @@ nsGlobalWindowInner::nsGlobalWindowInner(nsGlobalWindowOuter *aOuterWindow) // to create the entropy collector, so we should // try to get one until we succeed. - mSerial = nsContentUtils::InnerOrOuterWindowCreated(); - static bool sFirstTime = true; if (sFirstTime) { sFirstTime = false; @@ -1000,6 +1000,8 @@ nsGlobalWindowInner::nsGlobalWindowInner(nsGlobalWindowOuter *aOuterWindow) } #ifdef DEBUG + mSerial = nsContentUtils::InnerOrOuterWindowCreated(); + if (!PR_GetEnv("MOZ_QUIET")) { printf_stderr("++DOMWINDOW == %d (%p) [pid = %d] [serial = %d] [outer = %p]\n", nsContentUtils::GetCurrentInnerOrOuterWindowCount(), diff --git a/dom/base/nsGlobalWindowInner.h b/dom/base/nsGlobalWindowInner.h index 4090e27b94a7..435352eb8a60 100644 --- a/dom/base/nsGlobalWindowInner.h +++ b/dom/base/nsGlobalWindowInner.h @@ -511,10 +511,6 @@ public: virtual void DisableOrientationChangeListener() override; #endif - virtual uint32_t GetSerial() override { - return mSerial; - } - void AddSizeOfIncludingThis(nsWindowSizes& aWindowSizes) const; void NotifyIdleObserver(IdleObserverHolder* aIdleObserverHolder, @@ -1427,11 +1423,13 @@ protected: uint32_t mSuspendDepth; uint32_t mFreezeDepth; +#ifdef DEBUG + uint32_t mSerial; +#endif + // the method that was used to focus mFocusedNode uint32_t mFocusMethod; - uint32_t mSerial; - // The current idle request callback handle uint32_t mIdleRequestCallbackCounter; IdleRequests mIdleRequestCallbacks; diff --git a/dom/base/nsGlobalWindowOuter.cpp b/dom/base/nsGlobalWindowOuter.cpp index a54c3b9cb595..9f892e5d947b 100644 --- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp @@ -842,8 +842,8 @@ nsGlobalWindowOuter::nsGlobalWindowOuter(uint64_t aWindowID) mAllowScriptsToClose(false), mTopLevelOuterContentWindow(false), mHasStorageAccess(false), - mSerial(0), #ifdef DEBUG + mSerial(0), mSetOpenerWindowCalled(false), #endif mCleanedUp(false), @@ -868,9 +868,9 @@ nsGlobalWindowOuter::nsGlobalWindowOuter(uint64_t aWindowID) // to create the entropy collector, so we should // try to get one until we succeed. +#ifdef DEBUG mSerial = nsContentUtils::InnerOrOuterWindowCreated(); -#ifdef DEBUG if (!PR_GetEnv("MOZ_QUIET")) { printf_stderr("++DOMWINDOW == %d (%p) [pid = %d] [serial = %d] [outer = %p]\n", nsContentUtils::GetCurrentInnerOrOuterWindowCount(), diff --git a/dom/base/nsGlobalWindowOuter.h b/dom/base/nsGlobalWindowOuter.h index ec04c862f837..8343900cc8aa 100644 --- a/dom/base/nsGlobalWindowOuter.h +++ b/dom/base/nsGlobalWindowOuter.h @@ -490,10 +490,6 @@ public: bool aBlocked, nsIURI* aURIHint) override; - virtual uint32_t GetSerial() override { - return mSerial; - } - void AddSizeOfIncludingThis(nsWindowSizes& aWindowSizes) const; void AllowScriptsToClose() @@ -1133,9 +1129,9 @@ protected: nsCOMPtr mDocumentPrincipal; +#ifdef DEBUG uint32_t mSerial; -#ifdef DEBUG bool mSetOpenerWindowCalled; nsCOMPtr mLastOpenedURI; #endif diff --git a/dom/base/nsPIDOMWindow.h b/dom/base/nsPIDOMWindow.h index 01cb55c03ca0..efba7d6ebfda 100644 --- a/dom/base/nsPIDOMWindow.h +++ b/dom/base/nsPIDOMWindow.h @@ -568,13 +568,6 @@ public: */ virtual void SetHasGamepadEventListener(bool aHasGamepad = true) = 0; - /** - * NOTE! This function *will* be called on multiple threads so the - * implementation must not do any AddRef/Release or other actions that will - * mutate internal state. - */ - virtual uint32_t GetSerial() = 0; - /** * Return the window id of this window */ @@ -1099,13 +1092,6 @@ public: */ virtual nsresult SetArguments(nsIArray *aArguments) = 0; - /** - * NOTE! This function *will* be called on multiple threads so the - * implementation must not do any AddRef/Release or other actions that will - * mutate internal state. - */ - virtual uint32_t GetSerial() = 0; - /** * Return the window id of this window */