зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 7fc2698f9e19 (bug 1468099) for gtest failures on a CLOSED TREE
This commit is contained in:
Родитель
974bd72b3c
Коммит
7d78fd4903
|
@ -9,7 +9,6 @@
|
|||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/dom/TabChild.h"
|
||||
#include "mozilla/dom/DocGroup.h"
|
||||
#include "mozilla/dom/TimeoutManager.h"
|
||||
#include "mozilla/AbstractThread.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
|
@ -24,8 +23,6 @@ namespace dom {
|
|||
|
||||
static StaticRefPtr<TabGroup> sChromeTabGroup;
|
||||
|
||||
LinkedList<TabGroup> TabGroup::sTabGroups;
|
||||
|
||||
TabGroup::TabGroup(bool aIsChrome)
|
||||
: mLastWindowLeft(false)
|
||||
, mThrottledQueuesInitialized(false)
|
||||
|
@ -34,8 +31,6 @@ TabGroup::TabGroup(bool aIsChrome)
|
|||
, mIsChrome(aIsChrome)
|
||||
, mForegroundCount(0)
|
||||
{
|
||||
sTabGroups.insertBack(this);
|
||||
|
||||
CreateEventTargets(/* aNeedValidation = */ !aIsChrome);
|
||||
|
||||
// Do not throttle runnables from chrome windows. In theory we should
|
||||
|
@ -328,33 +323,5 @@ TabGroup::Count(bool aActiveOnly) const
|
|||
return count;
|
||||
}
|
||||
|
||||
/*static*/ bool
|
||||
TabGroup::HasOnlyThrottableTabs()
|
||||
{
|
||||
for (TabGroup* tabGroup = sTabGroups.getFirst(); tabGroup;
|
||||
tabGroup =
|
||||
static_cast<LinkedListElement<TabGroup>*>(tabGroup)->getNext()) {
|
||||
for (auto iter = tabGroup->Iter(); !iter.Done(); iter.Next()) {
|
||||
DocGroup* docGroup = iter.Get()->mDocGroup;
|
||||
for (auto* documentInDocGroup : *docGroup) {
|
||||
if (documentInDocGroup->IsCurrentActiveDocument()) {
|
||||
nsPIDOMWindowInner* win =
|
||||
documentInDocGroup->GetInnerWindow();
|
||||
if (win && win->IsCurrentInnerWindow()) {
|
||||
nsPIDOMWindowOuter* outer = win->GetOuterWindow();
|
||||
if (outer) {
|
||||
TimeoutManager& tm = win->TimeoutManager();
|
||||
if (!tm.BudgetThrottlingEnabled(outer->IsBackground())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -46,8 +46,7 @@ class TabChild;
|
|||
class DocGroup;
|
||||
class TabChild;
|
||||
|
||||
class TabGroup final : public SchedulerGroup,
|
||||
public LinkedListElement<TabGroup>
|
||||
class TabGroup final : public SchedulerGroup
|
||||
{
|
||||
private:
|
||||
class HashEntry : public nsCStringHashKey
|
||||
|
@ -147,16 +146,6 @@ public:
|
|||
return mNumOfIndexedDBDatabases;
|
||||
}
|
||||
|
||||
static LinkedList<TabGroup>& TabGroupList()
|
||||
{
|
||||
return sTabGroups;
|
||||
}
|
||||
|
||||
// This returns true if all the window objects in all the TabGroups are
|
||||
// either inactive (for example in bfcache) or are in background tabs which
|
||||
// can be throttled.
|
||||
static bool HasOnlyThrottableTabs();
|
||||
|
||||
private:
|
||||
virtual AbstractThread*
|
||||
AbstractMainThreadForImpl(TaskCategory aCategory) override;
|
||||
|
@ -178,8 +167,6 @@ private:
|
|||
DocGroupMap mDocGroups;
|
||||
nsTArray<nsPIDOMWindowOuter*> mWindows;
|
||||
uint32_t mForegroundCount;
|
||||
|
||||
static LinkedList<TabGroup> sTabGroups;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -111,8 +111,6 @@ public:
|
|||
nsIEventTarget*
|
||||
EventTarget();
|
||||
|
||||
bool BudgetThrottlingEnabled(bool aIsBackground) const;
|
||||
|
||||
static const uint32_t InvalidFiringId;
|
||||
|
||||
private:
|
||||
|
@ -151,6 +149,8 @@ private:
|
|||
void UpdateBudget(const TimeStamp& aNow,
|
||||
const TimeDuration& aDuration = TimeDuration());
|
||||
|
||||
bool BudgetThrottlingEnabled(bool aIsBackground) const;
|
||||
|
||||
private:
|
||||
struct Timeouts {
|
||||
explicit Timeouts(const TimeoutManager& aManager)
|
||||
|
|
Загрузка…
Ссылка в новой задаче