зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1419771 - Introduce DOMPrefs, a thread-safe access to preferences for DOM - part 20 - DevTools enabled, r=asuth
This commit is contained in:
Родитель
2bfde4fc2d
Коммит
4fe8b382b6
|
@ -53,6 +53,7 @@ PREF(WebkitBlinkDirectoryPickerEnabled, "dom.webkitBlink.dirPicker.enabled")
|
|||
PREF(NetworkInformationEnabled, "dom.netinfo.enabled")
|
||||
PREF(FetchObserverEnabled, "dom.fetchObserver.enabled")
|
||||
PREF(ResistFingerprintingEnabled, "privacy.resistFingerprinting")
|
||||
PREF(DevToolsEnabled, "devtools.enabled")
|
||||
|
||||
#undef PREF
|
||||
|
||||
|
|
|
@ -90,6 +90,9 @@ public:
|
|||
|
||||
// Returns true if the privacy.resistFingerprinting pref is set.
|
||||
static bool ResistFingerprintingEnabled();
|
||||
|
||||
// Returns true if the devtools.enabled pref is set.
|
||||
static bool DevToolsEnabled();
|
||||
};
|
||||
|
||||
} // dom namespace
|
||||
|
|
|
@ -295,7 +295,6 @@ bool nsContentUtils::sIsPerformanceNavigationTimingEnabled = false;
|
|||
bool nsContentUtils::sIsFormAutofillAutocompleteEnabled = false;
|
||||
bool nsContentUtils::sIsWebComponentsEnabled = false;
|
||||
bool nsContentUtils::sIsCustomElementsEnabled = false;
|
||||
bool nsContentUtils::sDevToolsEnabled = false;
|
||||
bool nsContentUtils::sSendPerformanceTimingNotifications = false;
|
||||
bool nsContentUtils::sUseActivityCursor = false;
|
||||
bool nsContentUtils::sAnimationsAPICoreEnabled = false;
|
||||
|
@ -660,9 +659,6 @@ nsContentUtils::Init()
|
|||
Preferences::AddBoolVarCache(&sIsCustomElementsEnabled,
|
||||
"dom.webcomponents.customelements.enabled", false);
|
||||
|
||||
Preferences::AddBoolVarCache(&sDevToolsEnabled,
|
||||
"devtools.enabled");
|
||||
|
||||
Preferences::AddIntVarCache(&sPrivacyMaxInnerWidth,
|
||||
"privacy.window.maxInnerWidth",
|
||||
1000);
|
||||
|
@ -11019,21 +11015,6 @@ nsContentUtils::ExtractErrorValues(JSContext* aCx,
|
|||
|
||||
#undef EXTRACT_EXN_VALUES
|
||||
|
||||
/* static */ bool
|
||||
nsContentUtils::DevToolsEnabled(JSContext* aCx)
|
||||
{
|
||||
if (NS_IsMainThread()) {
|
||||
return sDevToolsEnabled;
|
||||
}
|
||||
|
||||
workers::WorkerPrivate* workerPrivate = workers::GetWorkerPrivateFromContext(aCx);
|
||||
if (!workerPrivate) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return workerPrivate->DevToolsEnabled();
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
nsContentUtils::ContentIsLink(nsIContent* aContent)
|
||||
{
|
||||
|
|
|
@ -3403,7 +3403,6 @@ private:
|
|||
static bool sIsFormAutofillAutocompleteEnabled;
|
||||
static bool sIsWebComponentsEnabled;
|
||||
static bool sIsCustomElementsEnabled;
|
||||
static bool sDevToolsEnabled;
|
||||
static bool sSendPerformanceTimingNotifications;
|
||||
static bool sUseActivityCursor;
|
||||
static bool sAnimationsAPICoreEnabled;
|
||||
|
|
|
@ -1084,7 +1084,7 @@ Console::IsEnabled(JSContext* aCx) const
|
|||
}
|
||||
|
||||
// Make all Console API no-op if DevTools aren't enabled.
|
||||
return nsContentUtils::DevToolsEnabled(aCx);
|
||||
return DOMPrefs::DevToolsEnabled();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
// * First argument is the name of the pref.
|
||||
// * The name of the function that updates the new value of a pref.
|
||||
|
||||
WORKER_SIMPLE_PREF("devtools.enabled", DevToolsEnabled, DEVTOOLS_ENABLED)
|
||||
WORKER_PREF("intl.accept_languages", PrefLanguagesChanged)
|
||||
WORKER_PREF("general.appname.override", AppNameOverrideChanged)
|
||||
WORKER_PREF("general.appversion.override", AppVersionOverrideChanged)
|
||||
|
|
Загрузка…
Ссылка в новой задаче