Bug 1449064 (attempt 2) - Convert view_source.editor.external to a StaticPref. r=hsivonen

MozReview-Commit-ID: AxssCop2WH
This commit is contained in:
Nicholas Nethercote
2018-03-29 15:29:00 +11:00
parent 509c45a937
commit 0322cb99dc
5 changed files with 12 additions and 15 deletions

View File

@@ -13,6 +13,7 @@
#include "mozAutoDocUpdate.h"
#include "mozilla/IdleTaskRunner.h"
#include "mozilla/Preferences.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/css/Loader.h"
#include "nsContentUtils.h"
#include "nsError.h"
@@ -922,18 +923,10 @@ nsHtml5TreeOpExecutor::GetViewSourceBaseURI()
return mViewSourceBaseURI;
}
// static
void
nsHtml5TreeOpExecutor::InitializeStatics()
{
mozilla::Preferences::AddBoolVarCache(&sExternalViewSource,
"view_source.editor.external");
}
bool
nsHtml5TreeOpExecutor::IsExternalViewSource()
{
if (!sExternalViewSource) {
if (!StaticPrefs::view_source_editor_external()) {
return false;
}
bool isViewSource = false;
@@ -1192,4 +1185,3 @@ uint32_t nsHtml5TreeOpExecutor::sAppendBatchExaminations = 0;
uint32_t nsHtml5TreeOpExecutor::sLongestTimeOffTheEventLoop = 0;
uint32_t nsHtml5TreeOpExecutor::sTimesFlushLoopInterrupted = 0;
#endif
bool nsHtml5TreeOpExecutor::sExternalViewSource = false;