Backed out changeset 70d068cc946d (Bug 1374675)

This commit is contained in:
Bevis Tseng 2017-06-21 11:02:48 +08:00
Родитель dda9bab7b2
Коммит 4b59084943
5 изменённых файлов: 1 добавлений и 88 удалений

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

@ -26,8 +26,6 @@ static StaticRefPtr<TabGroup> sChromeTabGroup;
TabGroup::TabGroup(bool aIsChrome)
: mLastWindowLeft(false)
, mThrottledQueuesInitialized(false)
, mNumOfIndexedDBTransactions(0)
, mNumOfIndexedDBDatabases(0)
, mIsChrome(aIsChrome)
, mForegroundCount(0)
{

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

@ -127,18 +127,6 @@ public:
// the background.
bool IsBackground() const override;
// Increase/Decrease the number of IndexedDB transactions/databases for the
// decision making of the preemption in the scheduler.
Atomic<uint32_t>& IndexedDBTransactionCounter()
{
return mNumOfIndexedDBTransactions;
}
Atomic<uint32_t>& IndexedDBDatabaseCounter()
{
return mNumOfIndexedDBDatabases;
}
private:
virtual AbstractThread*
AbstractMainThreadForImpl(TaskCategory aCategory) override;
@ -152,8 +140,6 @@ private:
// Thread-safe members
Atomic<bool> mLastWindowLeft;
Atomic<bool> mThrottledQueuesInitialized;
Atomic<uint32_t> mNumOfIndexedDBTransactions;
Atomic<uint32_t> mNumOfIndexedDBDatabases;
const bool mIsChrome;
// Main thread only

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

@ -1609,9 +1609,7 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow)
#endif
mCanSkipCCGeneration(0),
mAutoActivateVRDisplayID(0),
mBeforeUnloadListenerCount(0),
mNumOfIndexedDBTransactions(0),
mNumOfIndexedDBDatabases(0)
mBeforeUnloadListenerCount(0)
{
AssertIsOnMainThread();
@ -15429,56 +15427,6 @@ nsGlobalWindow::GetIntlUtils(ErrorResult& aError)
}
#endif
#define DEFINE_INDEXEDDB_COUNTER_FOR(name) \
void \
nsPIDOMWindowInner::UpdateActive##name##Count(int32_t aDelta) \
{ \
nsGlobalWindow::Cast(this)->UpdateActive##name##Count(aDelta); \
} \
\
bool nsPIDOMWindowInner::HasActive##name##s() \
{ \
return nsGlobalWindow::Cast(this)->HasActive##name##s(); \
} \
\
void \
nsGlobalWindow::UpdateActive##name##Count(int32_t aDelta) \
{ \
if (aDelta == 0) { \
return; \
} \
\
DebugOnly<uint32_t> count = mNumOf##name##s; \
mNumOf##name##s += aDelta; \
TabGroup()->name##Counter() += aDelta; \
MOZ_ASSERT( \
aDelta > 0 ? mNumOf##name##s > count : mNumOf##name##s < count, \
"The counters are either overflow or underflow!"); \
} \
\
bool \
nsGlobalWindow::HasActive##name##s() \
{ \
MOZ_ASSERT(NS_IsMainThread()); \
MOZ_DIAGNOSTIC_ASSERT(IsInnerWindow()); \
\
if (!AsInner()->IsCurrentInnerWindow()) \
{ \
return false; \
} \
\
nsCOMPtr<nsPIDOMWindowOuter> topOutterWindow = this->GetScriptableTop(); \
MOZ_ASSERT(topOutterWindow); \
RefPtr<nsGlobalWindow> topInnerWindow = \
nsGlobalWindow::Cast(topOutterWindow->GetCurrentInnerWindow()); \
\
return topInnerWindow ? topInnerWindow->mNumOf##name##s > 0 : false; \
}
DEFINE_INDEXEDDB_COUNTER_FOR(IndexedDBTransaction)
DEFINE_INDEXEDDB_COUNTER_FOR(IndexedDBDatabase)
#undef DEFINE_INDEXEDDB_COUNTER_FOR
template class nsPIDOMWindow<mozIDOMWindowProxy>;
template class nsPIDOMWindow<mozIDOMWindow>;
template class nsPIDOMWindow<nsISupports>;

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

@ -1847,10 +1847,6 @@ public:
void InsertIdleCallback(mozilla::dom::IdleRequest* aRequest);
void RemoveIdleCallback(mozilla::dom::IdleRequest* aRequest);
void UpdateActiveIndexedDBTransactionCount(int32_t aDelta);
void UpdateActiveIndexedDBDatabaseCount(int32_t aDelta);
bool HasActiveIndexedDBTransactions();
bool HasActiveIndexedDBDatabases();
protected:
// These members are only used on outer window objects. Make sure
@ -2075,11 +2071,6 @@ protected:
uint32_t mAutoActivateVRDisplayID; // Outer windows only
int64_t mBeforeUnloadListenerCount; // Inner windows only
// The number of IndexedDB transactions/databases per tab counted at the top
// of inner window.
uint32_t mNumOfIndexedDBTransactions;
uint32_t mNumOfIndexedDBDatabases;
#ifdef ENABLE_INTL_API
RefPtr<mozilla::dom::IntlUtils> mIntlUtils;
#endif

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

@ -895,16 +895,6 @@ public:
bool IsRunningTimeout();
// Increase/Decrease the number of active IndexedDB transactions/databases for
// the decision making of timer-throttling.
void UpdateActiveIndexedDBTransactionCount(int32_t aDelta);
void UpdateActiveIndexedDBDatabaseCount(int32_t aDelta);
// Return true if there is any active IndexedDB trasnsaction/databases in any
// window of the same tab.
bool HasActiveIndexedDBTransactions();
bool HasActiveIndexedDBDatabases();
protected:
void CreatePerformanceObjectIfNeeded();
};