From bb718d74fc78a704ecb05911c4929d6b0f8960ff Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Thu, 13 Jun 2019 09:02:03 +0000 Subject: [PATCH] Bug 1490044 - Remove DOMPrefs. r=bzbarsky Differential Revision: https://phabricator.services.mozilla.com/D33510 --HG-- extra : moz-landing-system : lando --- dom/base/DOMPrefs.cpp | 34 ------------------- dom/base/DOMPrefs.h | 25 -------------- dom/base/MessageManagerGlobal.cpp | 4 +-- dom/base/StructuredCloneHolder.cpp | 1 - dom/base/moz.build | 2 -- dom/base/nsGlobalWindowInner.cpp | 3 +- dom/base/nsGlobalWindowInner.h | 1 - dom/base/nsJSUtils.cpp | 10 ++++++ dom/base/nsJSUtils.h | 2 ++ dom/cache/Cache.cpp | 1 - dom/canvas/ImageBitmap.cpp | 1 - dom/canvas/OffscreenCanvas.cpp | 1 - dom/canvas/OffscreenCanvas.h | 1 - dom/console/Console.cpp | 1 - dom/ipc/ContentChild.cpp | 3 -- dom/performance/Performance.h | 1 - .../PerformanceObserverEntryList.h | 1 - dom/push/PushManager.h | 1 - dom/push/PushSubscription.h | 1 - dom/push/PushSubscriptionOptions.h | 1 - dom/quota/StorageManager.cpp | 1 - dom/serviceworkers/ServiceWorkerEvents.h | 1 - dom/serviceworkers/ServiceWorkerManager.cpp | 1 - .../ServiceWorkerRegistration.h | 1 - .../ServiceWorkerRegistrationImpl.cpp | 1 - dom/workers/WorkerScope.cpp | 8 ++--- dom/workers/WorkerScope.h | 1 - dom/worklet/Worklet.cpp | 1 + dom/worklet/WorkletGlobalScope.cpp | 4 +-- js/xpconnect/loader/mozJSComponentLoader.cpp | 3 +- js/xpconnect/src/Sandbox.cpp | 3 +- js/xpconnect/src/XPCWrappedJSClass.cpp | 3 +- js/xpconnect/src/nsXPConnect.cpp | 6 ++-- layout/build/nsLayoutStatics.cpp | 1 - xpcom/tests/gtest/TestThreadMetrics.cpp | 1 - 35 files changed, 27 insertions(+), 104 deletions(-) delete mode 100644 dom/base/DOMPrefs.cpp delete mode 100644 dom/base/DOMPrefs.h diff --git a/dom/base/DOMPrefs.cpp b/dom/base/DOMPrefs.cpp deleted file mode 100644 index d959fd89367b..000000000000 --- a/dom/base/DOMPrefs.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "DOMPrefs.h" -#include "mozilla/Atomics.h" -#include "mozilla/Preferences.h" -#include "mozilla/StaticPrefs.h" - -namespace mozilla { -namespace dom { - -void DOMPrefs::Initialize() { - MOZ_ASSERT(NS_IsMainThread()); - - // Let's cache all the values on the main-thread. -#if !(defined(DEBUG) || defined(MOZ_ENABLE_JS_DUMP)) - DOMPrefs::DumpEnabled(); -#endif -} - -/* static */ -bool DOMPrefs::DumpEnabled() { -#if !(defined(DEBUG) || defined(MOZ_ENABLE_JS_DUMP)) - return StaticPrefs::browser_dom_window_dump_enabled(); -#else - return true; -#endif -} - -} // namespace dom -} // namespace mozilla diff --git a/dom/base/DOMPrefs.h b/dom/base/DOMPrefs.h deleted file mode 100644 index 9c6165dd77fe..000000000000 --- a/dom/base/DOMPrefs.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef mozilla_dom_DOMPrefs_h -#define mozilla_dom_DOMPrefs_h - -namespace mozilla { -namespace dom { - -class DOMPrefs final { - public: - // This must be called on the main-thread. - static void Initialize(); - - // Returns true if the browser.dom.window.dump.enabled pref is set. - static bool DumpEnabled(); -}; - -} // namespace dom -} // namespace mozilla - -#endif // mozilla_dom_DOMPrefs_h diff --git a/dom/base/MessageManagerGlobal.cpp b/dom/base/MessageManagerGlobal.cpp index af6a08756c4f..a29d51641657 100644 --- a/dom/base/MessageManagerGlobal.cpp +++ b/dom/base/MessageManagerGlobal.cpp @@ -6,8 +6,8 @@ #include "mozilla/dom/MessageManagerGlobal.h" #include "mozilla/IntentionalCrash.h" -#include "mozilla/dom/DOMPrefs.h" #include "nsContentUtils.h" +#include "nsJSUtils.h" #ifdef ANDROID # include @@ -20,7 +20,7 @@ namespace mozilla { namespace dom { void MessageManagerGlobal::Dump(const nsAString& aStr) { - if (!DOMPrefs::DumpEnabled()) { + if (!nsJSUtils::DumpEnabled()) { return; } diff --git a/dom/base/StructuredCloneHolder.cpp b/dom/base/StructuredCloneHolder.cpp index fd74ef616315..e0ab71edd521 100644 --- a/dom/base/StructuredCloneHolder.cpp +++ b/dom/base/StructuredCloneHolder.cpp @@ -13,7 +13,6 @@ #include "mozilla/dom/StructuredCloneBlob.h" #include "mozilla/dom/Directory.h" #include "mozilla/dom/DirectoryBinding.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/File.h" #include "mozilla/dom/FileList.h" #include "mozilla/dom/FileListBinding.h" diff --git a/dom/base/moz.build b/dom/base/moz.build index 2400aa1e4eaa..ce01d3893853 100644 --- a/dom/base/moz.build +++ b/dom/base/moz.build @@ -174,7 +174,6 @@ EXPORTS.mozilla.dom += [ 'DOMMozPromiseRequestHolder.h', 'DOMParser.h', 'DOMPoint.h', - 'DOMPrefs.h', 'DOMQuad.h', 'DOMRect.h', 'DOMRequest.h', @@ -291,7 +290,6 @@ UNIFIED_SOURCES += [ 'DOMMatrix.cpp', 'DOMParser.cpp', 'DOMPoint.cpp', - 'DOMPrefs.cpp', 'DOMQuad.cpp', 'DOMRect.cpp', 'DOMRequest.cpp', diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp index a9b951ac1711..d33d93e266f0 100644 --- a/dom/base/nsGlobalWindowInner.cpp +++ b/dom/base/nsGlobalWindowInner.cpp @@ -20,7 +20,6 @@ #include "mozilla/dom/ContentFrameMessageManager.h" #include "mozilla/dom/DocumentInlines.h" #include "mozilla/dom/DOMJSProxyHandler.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/EventTarget.h" #include "mozilla/dom/LocalStorage.h" #include "mozilla/dom/LocalStorageCommon.h" @@ -3412,7 +3411,7 @@ bool nsGlobalWindowInner::GetFullScreen() { } void nsGlobalWindowInner::Dump(const nsAString& aStr) { - if (!DOMPrefs::DumpEnabled()) { + if (!nsJSUtils::DumpEnabled()) { return; } diff --git a/dom/base/nsGlobalWindowInner.h b/dom/base/nsGlobalWindowInner.h index d5b44672c785..78075eef1bf9 100644 --- a/dom/base/nsGlobalWindowInner.h +++ b/dom/base/nsGlobalWindowInner.h @@ -34,7 +34,6 @@ #include "nsSize.h" #include "mozilla/FlushType.h" #include "prclist.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/ChromeMessageBroadcaster.h" #include "mozilla/dom/NavigatorBinding.h" diff --git a/dom/base/nsJSUtils.cpp b/dom/base/nsJSUtils.cpp index f627f9659912..055ae913c723 100644 --- a/dom/base/nsJSUtils.cpp +++ b/dom/base/nsJSUtils.cpp @@ -32,6 +32,7 @@ #include "nsGlobalWindow.h" #include "nsXBLPrototypeBinding.h" #include "mozilla/CycleCollectedJSContext.h" +#include "mozilla/StaticPrefs.h" #include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/Date.h" #include "mozilla/dom/Element.h" @@ -584,6 +585,15 @@ bool nsJSUtils::GetScopeChainForXBL( /* static */ void nsJSUtils::ResetTimeZone() { JS::ResetTimeZone(); } +/* static */ +bool nsJSUtils::DumpEnabled() { +#if defined(DEBUG) || defined(MOZ_ENABLE_JS_DUMP) + return true; +#else + return StaticPrefs::browser_dom_window_dump_enabled(); +#endif +} + // // nsDOMJSUtils.h // diff --git a/dom/base/nsJSUtils.h b/dom/base/nsJSUtils.h index 3be98fff30b5..d23b6f197717 100644 --- a/dom/base/nsJSUtils.h +++ b/dom/base/nsJSUtils.h @@ -237,6 +237,8 @@ class nsJSUtils { JS::MutableHandleVector aScopeChain); static void ResetTimeZone(); + + static bool DumpEnabled(); }; template diff --git a/dom/cache/Cache.cpp b/dom/cache/Cache.cpp index ee77b659ba2c..cb42e2e08684 100644 --- a/dom/cache/Cache.cpp +++ b/dom/cache/Cache.cpp @@ -17,7 +17,6 @@ #include "mozilla/dom/cache/CacheChild.h" #include "mozilla/dom/cache/CacheWorkerHolder.h" #include "mozilla/dom/cache/ReadStream.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/ErrorResult.h" #include "mozilla/Preferences.h" #include "mozilla/Unused.h" diff --git a/dom/canvas/ImageBitmap.cpp b/dom/canvas/ImageBitmap.cpp index c4c0fbc8a215..9c178711f295 100644 --- a/dom/canvas/ImageBitmap.cpp +++ b/dom/canvas/ImageBitmap.cpp @@ -6,7 +6,6 @@ #include "mozilla/dom/ImageBitmap.h" #include "mozilla/CheckedInt.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/HTMLMediaElementBinding.h" #include "mozilla/dom/ImageBitmapBinding.h" #include "mozilla/dom/Promise.h" diff --git a/dom/canvas/OffscreenCanvas.cpp b/dom/canvas/OffscreenCanvas.cpp index fec93ab41083..3d5bf7b68976 100644 --- a/dom/canvas/OffscreenCanvas.cpp +++ b/dom/canvas/OffscreenCanvas.cpp @@ -6,7 +6,6 @@ #include "OffscreenCanvas.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/OffscreenCanvasBinding.h" #include "mozilla/dom/WorkerPrivate.h" #include "mozilla/dom/WorkerScope.h" diff --git a/dom/canvas/OffscreenCanvas.h b/dom/canvas/OffscreenCanvas.h index 693ef44e8bd7..dbbcc855271b 100644 --- a/dom/canvas/OffscreenCanvas.h +++ b/dom/canvas/OffscreenCanvas.h @@ -9,7 +9,6 @@ #include "gfxTypes.h" #include "mozilla/DOMEventTargetHelper.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/layers/LayersTypes.h" #include "mozilla/RefPtr.h" #include "CanvasRenderingContextHelper.h" diff --git a/dom/console/Console.cpp b/dom/console/Console.cpp index 4c910900e98d..d583acc67dbc 100644 --- a/dom/console/Console.cpp +++ b/dom/console/Console.cpp @@ -11,7 +11,6 @@ #include "mozilla/dom/BlobBinding.h" #include "mozilla/dom/Document.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/Exceptions.h" #include "mozilla/dom/File.h" #include "mozilla/dom/FunctionBinding.h" diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index e895124e0286..0d3673cd734d 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -36,7 +36,6 @@ #include "mozilla/dom/ClientOpenWindowOpActors.h" #include "mozilla/dom/ChildProcessMessageManager.h" #include "mozilla/dom/ContentProcessMessageManager.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/DataTransfer.h" #include "mozilla/dom/DocGroup.h" @@ -1346,8 +1345,6 @@ void ContentChild::InitXPCOM( // Set the dynamic scalar definitions for this process. TelemetryIPC::AddDynamicScalarDefinitions(aXPCOMInit.dynamicScalarDefs()); - - DOMPrefs::Initialize(); } mozilla::ipc::IPCResult ContentChild::RecvRequestMemoryReport( diff --git a/dom/performance/Performance.h b/dom/performance/Performance.h index fb6bd5e1ff59..ae8f5987dce7 100644 --- a/dom/performance/Performance.h +++ b/dom/performance/Performance.h @@ -9,7 +9,6 @@ #include "mozilla/Attributes.h" #include "mozilla/DOMEventTargetHelper.h" -#include "mozilla/dom/DOMPrefs.h" #include "nsCOMPtr.h" #include "nsDOMNavigationTiming.h" diff --git a/dom/performance/PerformanceObserverEntryList.h b/dom/performance/PerformanceObserverEntryList.h index 1cc95e6881ba..1768e1dc74af 100644 --- a/dom/performance/PerformanceObserverEntryList.h +++ b/dom/performance/PerformanceObserverEntryList.h @@ -11,7 +11,6 @@ #include "nsISupports.h" #include "nsTArray.h" #include "nsWrapperCache.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/PerformanceEntryBinding.h" namespace mozilla { diff --git a/dom/push/PushManager.h b/dom/push/PushManager.h index b1907ddea921..261e265f4473 100644 --- a/dom/push/PushManager.h +++ b/dom/push/PushManager.h @@ -32,7 +32,6 @@ #include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/TypedArray.h" -#include "mozilla/dom/DOMPrefs.h" #include "nsCOMPtr.h" #include "mozilla/RefPtr.h" diff --git a/dom/push/PushSubscription.h b/dom/push/PushSubscription.h index ecce9df817f2..bd09b0f4369d 100644 --- a/dom/push/PushSubscription.h +++ b/dom/push/PushSubscription.h @@ -16,7 +16,6 @@ #include "mozilla/RefPtr.h" #include "mozilla/dom/BindingDeclarations.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/PushSubscriptionBinding.h" #include "mozilla/dom/PushSubscriptionOptionsBinding.h" #include "mozilla/dom/TypedArray.h" diff --git a/dom/push/PushSubscriptionOptions.h b/dom/push/PushSubscriptionOptions.h index 37bfcb76252d..225f1d99de5a 100644 --- a/dom/push/PushSubscriptionOptions.h +++ b/dom/push/PushSubscriptionOptions.h @@ -10,7 +10,6 @@ #include "nsCycleCollectionParticipant.h" #include "nsTArray.h" #include "nsWrapperCache.h" -#include "mozilla/dom/DOMPrefs.h" class nsIGlobalObject; diff --git a/dom/quota/StorageManager.cpp b/dom/quota/StorageManager.cpp index 4528b051e6d6..a6d7a85cdf2f 100644 --- a/dom/quota/StorageManager.cpp +++ b/dom/quota/StorageManager.cpp @@ -6,7 +6,6 @@ #include "StorageManager.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/PromiseWorkerProxy.h" #include "mozilla/dom/quota/QuotaManagerService.h" #include "mozilla/dom/StorageManagerBinding.h" diff --git a/dom/serviceworkers/ServiceWorkerEvents.h b/dom/serviceworkers/ServiceWorkerEvents.h index b8792990fd68..48965206bf12 100644 --- a/dom/serviceworkers/ServiceWorkerEvents.h +++ b/dom/serviceworkers/ServiceWorkerEvents.h @@ -7,7 +7,6 @@ #ifndef mozilla_dom_serviceworkerevents_h__ #define mozilla_dom_serviceworkerevents_h__ -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/Event.h" #include "mozilla/dom/ExtendableEventBinding.h" #include "mozilla/dom/ExtendableMessageEventBinding.h" diff --git a/dom/serviceworkers/ServiceWorkerManager.cpp b/dom/serviceworkers/ServiceWorkerManager.cpp index fe0f9243b927..221639edc9ed 100644 --- a/dom/serviceworkers/ServiceWorkerManager.cpp +++ b/dom/serviceworkers/ServiceWorkerManager.cpp @@ -40,7 +40,6 @@ #include "mozilla/dom/ClientSource.h" #include "mozilla/dom/ConsoleUtils.h" #include "mozilla/dom/ContentParent.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/ErrorEvent.h" #include "mozilla/dom/Headers.h" #include "mozilla/dom/InternalHeaders.h" diff --git a/dom/serviceworkers/ServiceWorkerRegistration.h b/dom/serviceworkers/ServiceWorkerRegistration.h index 1a8c6add5260..77b73eb6ccb3 100644 --- a/dom/serviceworkers/ServiceWorkerRegistration.h +++ b/dom/serviceworkers/ServiceWorkerRegistration.h @@ -8,7 +8,6 @@ #define mozilla_dom_ServiceWorkerRegistration_h #include "mozilla/DOMEventTargetHelper.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/ServiceWorkerBinding.h" #include "mozilla/dom/ServiceWorkerRegistrationBinding.h" #include "mozilla/dom/ServiceWorkerRegistrationDescriptor.h" diff --git a/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp b/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp index fdf4fb7bb434..32a55bb1deb3 100644 --- a/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp +++ b/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp @@ -7,7 +7,6 @@ #include "ServiceWorkerRegistrationImpl.h" #include "ipc/ErrorIPCUtils.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/Promise.h" #include "mozilla/dom/PromiseWorkerProxy.h" #include "mozilla/dom/PushManagerBinding.h" diff --git a/dom/workers/WorkerScope.cpp b/dom/workers/WorkerScope.cpp index 34a9240cd421..26b016df697a 100644 --- a/dom/workers/WorkerScope.cpp +++ b/dom/workers/WorkerScope.cpp @@ -14,7 +14,6 @@ #include "mozilla/dom/ClientState.h" #include "mozilla/dom/Console.h" #include "mozilla/dom/DedicatedWorkerGlobalScopeBinding.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/Fetch.h" #include "mozilla/dom/FunctionBinding.h" #include "mozilla/dom/IDBFactory.h" @@ -31,8 +30,9 @@ #include "mozilla/dom/WorkerLocation.h" #include "mozilla/dom/WorkerNavigator.h" #include "mozilla/dom/cache/CacheStorage.h" -#include "mozilla/StaticPrefs.h" #include "mozilla/StorageAccess.h" +#include "nsContentUtils.h" +#include "nsJSUtils.h" #include "nsServiceManagerUtils.h" #include "mozilla/dom/Document.h" @@ -347,11 +347,9 @@ void WorkerGlobalScope::Dump(const Optional& aString) const { return; } -#if !(defined(DEBUG) || defined(MOZ_ENABLE_JS_DUMP)) - if (!DOMPrefs::DumpEnabled()) { + if (!nsJSUtils::DumpEnabled()) { return; } -#endif NS_ConvertUTF16toUTF8 str(aString.Value()); diff --git a/dom/workers/WorkerScope.h b/dom/workers/WorkerScope.h index e906c0a21a08..0a178ede4fbf 100644 --- a/dom/workers/WorkerScope.h +++ b/dom/workers/WorkerScope.h @@ -10,7 +10,6 @@ #include "mozilla/Attributes.h" #include "mozilla/dom/WorkerCommon.h" #include "mozilla/DOMEventTargetHelper.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/Headers.h" #include "mozilla/dom/RequestBinding.h" #include "nsWeakReference.h" diff --git a/dom/worklet/Worklet.cpp b/dom/worklet/Worklet.cpp index 3d95bfe399e1..33a4a7a645b0 100644 --- a/dom/worklet/Worklet.cpp +++ b/dom/worklet/Worklet.cpp @@ -16,6 +16,7 @@ #include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/ScriptLoader.h" #include "mozilla/dom/WorkletImpl.h" +#include "mozilla/StaticPrefs.h" #include "js/CompilationAndEvaluation.h" #include "js/SourceText.h" #include "nsIInputStreamPump.h" diff --git a/dom/worklet/WorkletGlobalScope.cpp b/dom/worklet/WorkletGlobalScope.cpp index fe182f66eb2b..3ffbadd7ff93 100644 --- a/dom/worklet/WorkletGlobalScope.cpp +++ b/dom/worklet/WorkletGlobalScope.cpp @@ -8,7 +8,7 @@ #include "mozilla/dom/WorkletGlobalScopeBinding.h" #include "mozilla/dom/WorkletImpl.h" #include "mozilla/dom/Console.h" -#include "mozilla/StaticPrefs.h" +#include "nsJSUtils.h" namespace mozilla { namespace dom { @@ -66,7 +66,7 @@ already_AddRefed WorkletGlobalScope::GetConsole(JSContext* aCx, void WorkletGlobalScope::Dump(const Optional& aString) const { WorkletThread::AssertIsOnWorkletThread(); - if (!StaticPrefs::browser_dom_window_dump_enabled()) { + if (!nsJSUtils::DumpEnabled()) { return; } diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp index 73ad6ff9daa4..72fde826bd64 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/xpconnect/loader/mozJSComponentLoader.cpp @@ -55,7 +55,6 @@ #include "mozilla/Preferences.h" #include "mozilla/ResultExtensions.h" #include "mozilla/ScriptPreloader.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/ScriptSettings.h" #include "mozilla/ResultExtensions.h" #include "mozilla/UniquePtrExtensions.h" @@ -93,7 +92,7 @@ static LazyLogModule gJSCLLog("JSComponentLoader"); #define ERROR_SETTING_SYMBOL "%s - Could not set symbol '%s' on target object." static bool Dump(JSContext* cx, unsigned argc, Value* vp) { - if (!mozilla::dom::DOMPrefs::DumpEnabled()) { + if (!nsJSUtils::DumpEnabled()) { return true; } diff --git a/js/xpconnect/src/Sandbox.cpp b/js/xpconnect/src/Sandbox.cpp index 744ff223f28b..7d2fae622935 100644 --- a/js/xpconnect/src/Sandbox.cpp +++ b/js/xpconnect/src/Sandbox.cpp @@ -37,7 +37,6 @@ #include "mozilla/dom/CSSRuleBinding.h" #include "mozilla/dom/DirectoryBinding.h" #include "mozilla/dom/DOMParserBinding.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/ElementBinding.h" #include "mozilla/dom/EventBinding.h" #include "mozilla/dom/IndexedDatabaseManager.h" @@ -125,7 +124,7 @@ already_AddRefed xpc::NewSandboxConstructor() { } static bool SandboxDump(JSContext* cx, unsigned argc, Value* vp) { - if (!DOMPrefs::DumpEnabled()) { + if (!nsJSUtils::DumpEnabled()) { return true; } diff --git a/js/xpconnect/src/XPCWrappedJSClass.cpp b/js/xpconnect/src/XPCWrappedJSClass.cpp index 604036b27a0e..2a0bbc0227a2 100644 --- a/js/xpconnect/src/XPCWrappedJSClass.cpp +++ b/js/xpconnect/src/XPCWrappedJSClass.cpp @@ -19,7 +19,6 @@ #include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/DOMException.h" #include "mozilla/dom/DOMExceptionBinding.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/MozQueryInterface.h" #include "mozilla/jsipc/CrossProcessObjectWrappers.h" @@ -657,7 +656,7 @@ nsresult nsXPCWrappedJS::CheckForException(XPCCallContext& ccx, } if (reportable) { - if (DOMPrefs::DumpEnabled()) { + if (nsJSUtils::DumpEnabled()) { static const char line[] = "************************************************************\n"; static const char preamble[] = diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index fd1a102b0ea0..73195574d325 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -24,7 +24,6 @@ #include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/DOMException.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/Exceptions.h" #include "mozilla/dom/Promise.h" @@ -38,6 +37,7 @@ #include "nsIScriptError.h" #include "nsContentUtils.h" #include "nsScriptError.h" +#include "nsJSUtils.h" using namespace mozilla; using namespace mozilla::dom; @@ -259,7 +259,7 @@ void xpc::ErrorBase::AppendErrorDetailsTo(nsCString& error) { } void xpc::ErrorNote::LogToStderr() { - if (!DOMPrefs::DumpEnabled()) { + if (!nsJSUtils::DumpEnabled()) { return; } @@ -272,7 +272,7 @@ void xpc::ErrorNote::LogToStderr() { } void xpc::ErrorReport::LogToStderr() { - if (!DOMPrefs::DumpEnabled()) { + if (!nsJSUtils::DumpEnabled()) { return; } diff --git a/layout/build/nsLayoutStatics.cpp b/layout/build/nsLayoutStatics.cpp index d55d61810d5e..520cedee02dc 100644 --- a/layout/build/nsLayoutStatics.cpp +++ b/layout/build/nsLayoutStatics.cpp @@ -302,7 +302,6 @@ nsresult nsLayoutStatics::Initialize() { if (XRE_IsParentProcess()) { // On content process we initialize these components when PContentChild is // fully initialized. - mozilla::dom::DOMPrefs::Initialize(); mozilla::dom::RemoteWorkerService::Initialize(); // This one should be initialized on the parent only mozilla::dom::BrowserParent::InitializeStatics(); diff --git a/xpcom/tests/gtest/TestThreadMetrics.cpp b/xpcom/tests/gtest/TestThreadMetrics.cpp index 11756474163c..244e2344a3ca 100644 --- a/xpcom/tests/gtest/TestThreadMetrics.cpp +++ b/xpcom/tests/gtest/TestThreadMetrics.cpp @@ -9,7 +9,6 @@ #include "mozilla/AbstractThread.h" #include "mozilla/Preferences.h" #include "mozilla/dom/DocGroup.h" -#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/TabGroup.h" #include "mozilla/SchedulerGroup.h" #include "mozilla/TaskCategory.h"