Bug 1570082 - Convert content.notify.backoffcount to static pref. r=njn

Converts content.notify.backoffcount varcache pref to static pref.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
kriswright 2019-08-01 16:06:56 +00:00
Родитель f22377c729
Коммит 9783b23738
3 изменённых файлов: 8 добавлений и 7 удалений

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

@ -135,7 +135,6 @@ nsContentSink::~nsContentSink() {
}
}
int32_t nsContentSink::sBackoffCount;
int32_t nsContentSink::sNotificationInterval;
int32_t nsContentSink::sInteractiveDeflectCount;
int32_t nsContentSink::sPerfDeflectCount;
@ -148,9 +147,6 @@ int32_t nsContentSink::sInitialPerfTime;
int32_t nsContentSink::sEnablePerfMode;
void nsContentSink::InitializeStatics() {
// -1 means never.
Preferences::AddIntVarCache(&sBackoffCount, "content.notify.backoffcount",
-1);
// The gNotificationInterval has a dramatic effect on how long it
// takes to initially display content for slow connections.
// The current value provides good
@ -210,7 +206,7 @@ nsresult nsContentSink::Init(Document* aDoc, nsIURI* aURI,
mNodeInfoManager = aDoc->NodeInfoManager();
mBackoffCount = sBackoffCount;
mBackoffCount = StaticPrefs::content_notify_backoffcount();
if (sEnablePerfMode != 0) {
mDynamicLowerValue = sEnablePerfMode == 1;

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

@ -337,8 +337,6 @@ class nsContentSink : public nsICSSLoaderObserver,
nsRevocableEventPtr<nsRunnableMethod<nsContentSink, void, false> >
mProcessLinkHeaderEvent;
// Back off timer notification after count.
static int32_t sBackoffCount;
// Notification interval in microseconds
static int32_t sNotificationInterval;
// How many times to deflect in interactive/perf modes

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

@ -978,6 +978,13 @@
# Prefs starting with "content."
#---------------------------------------------------------------------------
# Back off timer notification after count.
# -1 means never.
- name: content.notify.backoffcount
type: int32_t
value: -1
mirror: always
# Do we notify based on time?
- name: content.notify.ontimer
type: bool