Bug 1570082 - Convert content.sink.*_deflect_count to static pref. r=njn

Converts the varcache prefs 'content.sink.interactive_deflect_count' and 'content.sink.perf_deflect_count' to static prefs.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
kriswright 2019-08-01 17:05:57 +00:00
Родитель f1b12f5aa9
Коммит 4e66b9f614
3 изменённых файлов: 19 добавлений и 13 удалений

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

@ -134,9 +134,6 @@ nsContentSink::~nsContentSink() {
mDocument->RemoveObserver(this);
}
}
int32_t nsContentSink::sInteractiveDeflectCount;
int32_t nsContentSink::sPerfDeflectCount;
int32_t nsContentSink::sPendingEventMode;
int32_t nsContentSink::sEventProbeRate;
int32_t nsContentSink::sInteractiveParseTime;
@ -146,10 +143,6 @@ int32_t nsContentSink::sInitialPerfTime;
int32_t nsContentSink::sEnablePerfMode;
void nsContentSink::InitializeStatics() {
Preferences::AddIntVarCache(&sInteractiveDeflectCount,
"content.sink.interactive_deflect_count", 0);
Preferences::AddIntVarCache(&sPerfDeflectCount,
"content.sink.perf_deflect_count", 200);
Preferences::AddIntVarCache(&sPendingEventMode,
"content.sink.pending_event_mode", 1);
Preferences::AddIntVarCache(&sEventProbeRate, "content.sink.event_probe_rate",
@ -1377,8 +1370,10 @@ nsresult nsContentSink::DidProcessATokenImpl() {
// Have we processed enough tokens to check time?
if (!mHasPendingEvent &&
mDeflectedCount < uint32_t(mDynamicLowerValue ? sInteractiveDeflectCount
: sPerfDeflectCount)) {
mDeflectedCount <
uint32_t(mDynamicLowerValue
? StaticPrefs::content_sink_interactive_deflect_count()
: StaticPrefs::content_sink_perf_deflect_count())) {
return NS_OK;
}

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

@ -268,7 +268,9 @@ class nsContentSink : public nsICSSLoaderObserver,
void DoProcessLinkHeader();
void StopDeflecting() { mDeflectedCount = sPerfDeflectCount; }
void StopDeflecting() {
mDeflectedCount = mozilla::StaticPrefs::content_sink_perf_deflect_count();
}
protected:
RefPtr<Document> mDocument;
@ -337,9 +339,6 @@ class nsContentSink : public nsICSSLoaderObserver,
nsRevocableEventPtr<nsRunnableMethod<nsContentSink, void, false> >
mProcessLinkHeaderEvent;
// How many times to deflect in interactive/perf modes
static int32_t sInteractiveDeflectCount;
static int32_t sPerfDeflectCount;
// 0 = don't check for pending events
// 1 = don't deflect if there are pending events
// 2 = bail if there are pending events

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

@ -1003,6 +1003,18 @@
value: true
mirror: always
# How many times to deflect in interactive mode.
- name: content.sink.interactive_deflect_count
type: int32_t
value: 0
mirror: always
# How many times to deflect in perf mode.
- name: content.sink.perf_deflect_count
type: int32_t
value: 200
mirror: always
#---------------------------------------------------------------------------
# Prefs starting with "device."
#---------------------------------------------------------------------------