Bug 1657841 - Remove unused visible tabs tracking. r=edgar

This stopped being used at some point and now it's just useless.

Differential Revision: https://phabricator.services.mozilla.com/D86322
This commit is contained in:
Emilio Cobos Álvarez 2020-08-07 09:40:07 +00:00
parent b043933d2f
commit ac6059e379
3 changed files with 1 additions and 42 deletions

View File

@ -4572,8 +4572,7 @@ nsDocShell::SetIsActive(bool aIsActive) {
// Tell the nsDOMNavigationTiming about it // Tell the nsDOMNavigationTiming about it
RefPtr<nsDOMNavigationTiming> timing = mTiming; RefPtr<nsDOMNavigationTiming> timing = mTiming;
if (!timing && mContentViewer) { if (!timing && mContentViewer) {
Document* doc = mContentViewer->GetDocument(); if (Document* doc = mContentViewer->GetDocument()) {
if (doc) {
timing = doc->GetNavigationTiming(); timing = doc->GetNavigationTiming();
} }
} }

View File

@ -160,8 +160,6 @@ NS_IMPL_ISUPPORTS(ContentListener, nsIDOMEventListener)
static const char BEFORE_FIRST_PAINT[] = "before-first-paint"; static const char BEFORE_FIRST_PAINT[] = "before-first-paint";
nsTHashtable<nsPtrHashKey<BrowserChild>>* BrowserChild::sVisibleTabs;
typedef nsDataHashtable<nsUint64HashKey, BrowserChild*> BrowserChildMap; typedef nsDataHashtable<nsUint64HashKey, BrowserChild*> BrowserChildMap;
static BrowserChildMap* sBrowserChildren; static BrowserChildMap* sBrowserChildren;
StaticMutex sBrowserChildrenMutex; StaticMutex sBrowserChildrenMutex;
@ -943,13 +941,6 @@ void BrowserChild::ActorDestroy(ActorDestroyReason why) {
BrowserChild::~BrowserChild() { BrowserChild::~BrowserChild() {
mAnonymousGlobalScopes.Clear(); mAnonymousGlobalScopes.Clear();
if (sVisibleTabs) {
sVisibleTabs->RemoveEntry(this);
if (sVisibleTabs->IsEmpty()) {
delete sVisibleTabs;
sVisibleTabs = nullptr;
}
}
DestroyWindow(); DestroyWindow();
@ -2779,11 +2770,6 @@ void BrowserChild::MakeVisible() {
return; return;
} }
if (!sVisibleTabs) {
sVisibleTabs = new nsTHashtable<nsPtrHashKey<BrowserChild>>();
}
sVisibleTabs->PutEntry(this);
if (mPuppetWidget) { if (mPuppetWidget) {
mPuppetWidget->Show(true); mPuppetWidget->Show(true);
} }
@ -2817,12 +2803,6 @@ void BrowserChild::MakeVisible() {
} }
void BrowserChild::MakeHidden() { void BrowserChild::MakeHidden() {
if (sVisibleTabs) {
sVisibleTabs->RemoveEntry(this);
// We don't delete sVisibleTabs here when it's empty since that
// could cause a lot of churn. Instead, we wait until ~BrowserChild.
}
if (!IsVisible()) { if (!IsVisible()) {
return; return;
} }

View File

@ -664,20 +664,6 @@ class BrowserChild final : public nsMessageManagerScriptExecutor,
mCancelContentJSEpoch = aEpoch; mCancelContentJSEpoch = aEpoch;
} }
static bool HasVisibleTabs() {
return sVisibleTabs && !sVisibleTabs->IsEmpty();
}
// Returns the set of BrowserChilds that are currently rendering layers. There
// can be multiple BrowserChilds in this state if Firefox has multiple windows
// open or is warming tabs up. There can also be zero BrowserChilds in this
// state. Note that this function should only be called if HasVisibleTabs()
// returns true.
static const nsTHashtable<nsPtrHashKey<BrowserChild>>& GetVisibleTabs() {
MOZ_ASSERT(HasVisibleTabs());
return *sVisibleTabs;
}
bool UpdateSessionStore(uint32_t aFlushId, bool aIsFinal = false); bool UpdateSessionStore(uint32_t aFlushId, bool aIsFinal = false);
#ifdef XP_WIN #ifdef XP_WIN
@ -934,12 +920,6 @@ class BrowserChild final : public nsMessageManagerScriptExecutor,
Maybe<bool> mWindowSupportsProtectedMedia; Maybe<bool> mWindowSupportsProtectedMedia;
#endif #endif
// This state is used to keep track of the current visible tabs (the ones
// rendering layers). There may be more than one if there are multiple browser
// windows open, or tabs are being warmed up. There may be none if this
// process does not host any visible or warming tabs.
static nsTHashtable<nsPtrHashKey<BrowserChild>>* sVisibleTabs;
DISALLOW_EVIL_CONSTRUCTORS(BrowserChild); DISALLOW_EVIL_CONSTRUCTORS(BrowserChild);
}; };