mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
Bug 1159003 - setResourceTimingBufferSize shouldn't affect user timing, but we should clean user markers if we have memory pressure, r=bz
This commit is contained in:
parent
6beccbf6ce
commit
bc3eb89dee
5 changed files with 40 additions and 17 deletions
|
|
@ -318,6 +318,8 @@ nsGlobalWindow::DOMMinTimeoutValue() const {
|
|||
// nsTimerImpl.h for details.
|
||||
#define DOM_MAX_TIMEOUT_VALUE DELAY_INTERVAL_LIMIT
|
||||
|
||||
#define MEMORY_PRESSURE_OBSERVER_TOPIC "memory-pressure"
|
||||
|
||||
// The interval at which we execute idle callbacks
|
||||
static uint32_t gThrottledIdlePeriodLength;
|
||||
|
||||
|
|
@ -1525,6 +1527,8 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow)
|
|||
// Watch for dom-storage2-changed so we can fire storage
|
||||
// events. Use a strong reference.
|
||||
os->AddObserver(mObserver, "dom-storage2-changed", false);
|
||||
|
||||
os->AddObserver(mObserver, MEMORY_PRESSURE_OBSERVER_TOPIC, false);
|
||||
}
|
||||
|
||||
Preferences::AddStrongObserver(mObserver, "intl.accept_languages");
|
||||
|
|
@ -1840,6 +1844,7 @@ nsGlobalWindow::CleanUp()
|
|||
if (os) {
|
||||
os->RemoveObserver(mObserver, NS_IOSERVICE_OFFLINE_STATUS_TOPIC);
|
||||
os->RemoveObserver(mObserver, "dom-storage2-changed");
|
||||
os->RemoveObserver(mObserver, MEMORY_PRESSURE_OBSERVER_TOPIC);
|
||||
}
|
||||
|
||||
if (mIdleService) {
|
||||
|
|
@ -11702,6 +11707,13 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!nsCRT::strcmp(aTopic, MEMORY_PRESSURE_OBSERVER_TOPIC)) {
|
||||
if (mPerformance) {
|
||||
mPerformance->MemoryPressure();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!nsCRT::strcmp(aTopic, OBSERVER_TOPIC_IDLE)) {
|
||||
mCurrentlyIdle = true;
|
||||
if (IsFrozen()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue