Bug 1588720 - Part 3: Remove nsGlobalWindowOuter::gOpenPopupSpamCount; r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D49277

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Edgar Chen 2019-10-18 03:05:18 +00:00
Родитель e6da573de1
Коммит 20956de078
2 изменённых файлов: 0 добавлений и 31 удалений

Просмотреть файл

@ -319,8 +319,6 @@ extern mozilla::LazyLogModule gMediaControlLog;
static LazyLogModule gDOMLeakPRLogOuter("DOMLeakOuter");
extern LazyLogModule gPageCacheLog;
static int32_t gOpenPopupSpamCount = 0;
nsGlobalWindowOuter::OuterWindowByIdTable*
nsGlobalWindowOuter::sOuterWindowsById = nullptr;
@ -1274,23 +1272,6 @@ void nsGlobalWindowOuter::ShutDown() {
sOuterWindowsById = nullptr;
}
void nsGlobalWindowOuter::MaybeForgiveSpamCount() {
if (IsPopupSpamWindow()) {
SetIsPopupSpamWindow(false);
}
}
void nsGlobalWindowOuter::SetIsPopupSpamWindow(bool aIsPopupSpam) {
mIsPopupSpam = aIsPopupSpam;
if (aIsPopupSpam) {
++gOpenPopupSpamCount;
} else {
--gOpenPopupSpamCount;
NS_ASSERTION(gOpenPopupSpamCount >= 0,
"Unbalanced decrement of gOpenPopupSpamCount");
}
}
void nsGlobalWindowOuter::DropOuterWindowDocs() {
MOZ_ASSERT_IF(mDoc, !mDoc->EventHandlingSuppressed());
mDoc = nullptr;
@ -2530,7 +2511,6 @@ void nsGlobalWindowOuter::DetachFromDocShell() {
mDocShell = nullptr;
mBrowsingContext->ClearDocShell();
MaybeForgiveSpamCount();
CleanUp();
}
@ -6150,7 +6130,6 @@ class nsCloseEvent : public Runnable {
static nsresult PostCloseEvent(nsGlobalWindowOuter* aWindow, bool aIndirect) {
nsCOMPtr<nsIRunnable> ev = new nsCloseEvent(aWindow, aIndirect);
nsresult rv = aWindow->Dispatch(TaskCategory::Other, ev.forget());
if (NS_SUCCEEDED(rv)) aWindow->MaybeForgiveSpamCount();
return rv;
}

Просмотреть файл

@ -455,7 +455,6 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
*/
nsresult SetArguments(nsIArray* aArguments);
void MaybeForgiveSpamCount();
bool IsClosedOrClosing() {
return (mIsClosed || mInClose || mHavePendingClose || mCleanedUp);
}
@ -751,13 +750,6 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
// Get the parent, returns null if this is a toplevel window
nsPIDOMWindowOuter* GetInProcessParentInternal();
public:
// popup tracking
bool IsPopupSpamWindow();
// Outer windows only.
void SetIsPopupSpamWindow(bool aIsPopupSpam);
protected:
// Window Control Functions
@ -1210,8 +1202,6 @@ inline bool nsGlobalWindowOuter::IsTopLevelWindow() {
return parentWindow == this;
}
inline bool nsGlobalWindowOuter::IsPopupSpamWindow() { return mIsPopupSpam; }
inline bool nsGlobalWindowOuter::IsFrame() {
return GetInProcessParentInternal() != nullptr;
}