From 7c7704aa07900edb7cc68ce39da9ba40b5a75364 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Thu, 14 Aug 2014 18:47:15 -0700 Subject: [PATCH] Bug 1052052 - Hoist Auto*JSContext into nsContentUtils and kill nsCxPusher.{cpp,h}. r=gabor --- caps/nsPrincipal.cpp | 2 +- caps/nsScriptSecurityManager.cpp | 2 +- content/base/public/nsContentUtils.h | 2 +- content/base/src/nsContentUtils.cpp | 1 - content/base/src/nsDocument.cpp | 1 - content/base/src/nsFrameMessageManager.cpp | 2 +- content/base/src/nsNodeUtils.cpp | 1 - content/base/src/nsObjectLoadingContent.cpp | 1 - content/base/src/nsScriptLoader.cpp | 1 - content/base/src/nsXMLHttpRequest.cpp | 1 - dom/audiochannel/AudioChannelService.cpp | 1 - dom/base/DOMRequest.cpp | 1 - dom/base/ScriptSettings.cpp | 88 +++++++++++++++ dom/base/ScriptSettings.h | 70 ++++++++++++ dom/base/nsContentPermissionHelper.cpp | 1 - dom/base/nsDOMClassInfo.cpp | 1 - dom/base/nsGlobalWindow.cpp | 1 - dom/base/nsJSEnvironment.cpp | 1 - dom/bindings/CallbackObject.cpp | 1 - dom/bindings/Codegen.py | 1 - dom/bluetooth/BluetoothReplyRunnable.cpp | 1 + dom/bluetooth/BluetoothService.cpp | 1 - dom/bluetooth/bluedroid/BluetoothUtils.cpp | 1 - dom/bluetooth/bluez/BluetoothUtils.cpp | 1 - dom/bluetooth2/BluetoothReplyRunnable.cpp | 1 + dom/bluetooth2/BluetoothService.cpp | 1 - dom/bluetooth2/bluedroid/BluetoothUtils.cpp | 2 +- dom/bluetooth2/bluez/BluetoothUtils.cpp | 2 +- dom/browser-element/BrowserElementParent.cpp | 1 - dom/canvas/WebGLContextUtils.cpp | 3 +- dom/devicestorage/nsDeviceStorage.cpp | 1 - dom/events/EventListenerService.cpp | 1 - dom/fmradio/FMRadioService.cpp | 2 +- dom/indexedDB/IDBFactory.cpp | 1 - dom/indexedDB/IDBFileRequest.cpp | 1 - dom/indexedDB/IDBRequest.cpp | 1 - dom/indexedDB/ipc/IndexedDBParent.cpp | 1 - dom/ipc/PreallocatedProcessManager.cpp | 2 +- dom/ipc/TabChild.cpp | 1 - dom/media/GetUserMediaRequest.cpp | 1 - dom/media/MediaPermissionGonk.cpp | 1 - .../src/MobileConnectionInfo.cpp | 3 +- dom/mobilemessage/src/MmsMessage.cpp | 2 +- .../src/MobileMessageCallback.cpp | 1 - dom/mobilemessage/src/ipc/SmsIPCService.cpp | 1 - dom/mobilemessage/src/ipc/SmsParent.cpp | 1 - dom/network/src/TCPSocketParent.cpp | 2 +- dom/nfc/gonk/NfcService.cpp | 1 - dom/plugins/base/nsJSNPRuntime.cpp | 1 - dom/plugins/base/nsNPAPIPlugin.cpp | 1 - dom/plugins/base/nsNPAPIPlugin.h | 3 +- dom/plugins/ipc/PluginIdentifierParent.cpp | 1 - .../ipc/PluginScriptableObjectParent.cpp | 1 - dom/src/jsurl/nsJSProtocolHandler.cpp | 1 - dom/system/gonk/AudioManager.cpp | 2 +- dom/system/gonk/AutoMounterSetting.cpp | 2 +- dom/system/gonk/NetworkWorker.cpp | 2 +- dom/system/gonk/SystemWorkerManager.cpp | 2 +- dom/system/gonk/TimeZoneSettingObserver.cpp | 2 +- dom/telephony/Telephony.cpp | 1 - dom/time/DateCacheCleaner.cpp | 2 +- dom/wifi/WifiCertService.cpp | 1 - dom/wifi/WifiProxyService.cpp | 1 - dom/wifi/WifiUtils.h | 1 - dom/workers/ServiceWorkerManager.cpp | 1 - dom/workers/WorkerPrivate.cpp | 1 - dom/workers/XMLHttpRequest.cpp | 1 - dom/xbl/nsXBLDocumentInfo.cpp | 1 - dom/xbl/nsXBLProtoImpl.cpp | 1 - dom/xbl/nsXBLProtoImplMethod.cpp | 1 - dom/xbl/nsXBLProtoImplProperty.cpp | 1 - dom/xbl/nsXBLPrototypeHandler.cpp | 1 - dom/xbl/nsXBLSerialize.cpp | 1 - .../autoconfig/src/nsJSConfigTriggers.cpp | 1 - ipc/testshell/XPCShellEnvironment.cpp | 1 - js/ipc/JavaScriptChild.cpp | 1 - js/ipc/WrapperAnswer.cpp | 1 - js/xpconnect/loader/mozJSComponentLoader.h | 2 +- js/xpconnect/src/Sandbox.cpp | 1 - js/xpconnect/src/XPCJSRuntime.cpp | 1 - js/xpconnect/src/XPCVariant.cpp | 1 - js/xpconnect/src/XPCWrappedJS.cpp | 1 - js/xpconnect/src/XPCWrappedNative.cpp | 1 - js/xpconnect/src/XPCWrappedNativeInfo.cpp | 1 - js/xpconnect/src/XPCWrappedNativeProto.cpp | 1 - js/xpconnect/src/moz.build | 2 - js/xpconnect/src/nsCxPusher.cpp | 104 ------------------ js/xpconnect/src/nsCxPusher.h | 86 --------------- js/xpconnect/src/xpcprivate.h | 11 +- netwerk/base/src/Dashboard.cpp | 1 - netwerk/protocol/app/AppProtocolHandler.cpp | 3 +- .../mozapps/extensions/AddonPathService.cpp | 2 +- xpcom/reflect/xptinfo/xptiInterfaceInfo.cpp | 2 +- 93 files changed, 196 insertions(+), 279 deletions(-) delete mode 100644 js/xpconnect/src/nsCxPusher.cpp delete mode 100644 js/xpconnect/src/nsCxPusher.h diff --git a/caps/nsPrincipal.cpp b/caps/nsPrincipal.cpp index 2fcad5ed504..661f7b96bb0 100644 --- a/caps/nsPrincipal.cpp +++ b/caps/nsPrincipal.cpp @@ -19,9 +19,9 @@ #include "nsIClassInfoImpl.h" #include "nsError.h" #include "nsIContentSecurityPolicy.h" -#include "nsCxPusher.h" #include "jswrapper.h" +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/Preferences.h" #include "mozilla/HashFunctions.h" diff --git a/caps/nsScriptSecurityManager.cpp b/caps/nsScriptSecurityManager.cpp index 2c15f4c2e3d..0c3d7bd3e4f 100644 --- a/caps/nsScriptSecurityManager.cpp +++ b/caps/nsScriptSecurityManager.cpp @@ -61,10 +61,10 @@ #include "mozilla/Preferences.h" #include "mozilla/dom/BindingUtils.h" #include +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/ClearOnShutdown.h" #include "mozilla/StaticPtr.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsJSUtils.h" #include "nsILoadInfo.h" diff --git a/content/base/public/nsContentUtils.h b/content/base/public/nsContentUtils.h index 4726d89f1ba..e67be4a1081 100644 --- a/content/base/public/nsContentUtils.h +++ b/content/base/public/nsContentUtils.h @@ -24,11 +24,11 @@ #include "mozilla/GuardObjects.h" #include "mozilla/TimeStamp.h" #include "nsContentListDeclarations.h" -#include "nsCxPusher.h" #include "nsMathUtils.h" #include "nsTArrayForwardDeclare.h" #include "Units.h" #include "mozilla/dom/AutocompleteInfoBinding.h" +#include "mozilla/dom/ScriptSettings.h" #if defined(XP_WIN) // Undefine LoadImage to prevent naming conflict with Windows. diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index 4837b9fa934..3fe31b825d9 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -12,7 +12,6 @@ #include #include "prprf.h" -#include "nsCxPusher.h" #include "DecoderTraits.h" #include "harfbuzz/hb.h" #include "imgICache.h" diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index a06b0c2e404..eca503a7817 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -39,7 +39,6 @@ #include "nsIDocShellTreeItem.h" #include "nsCOMArray.h" #include "nsDOMClassInfo.h" -#include "nsCxPusher.h" #include "mozilla/AsyncEventDispatcher.h" #include "mozilla/BasicEvents.h" diff --git a/content/base/src/nsFrameMessageManager.cpp b/content/base/src/nsFrameMessageManager.cpp index bcf47bbbbfc..6fb3b596fa3 100644 --- a/content/base/src/nsFrameMessageManager.cpp +++ b/content/base/src/nsFrameMessageManager.cpp @@ -10,7 +10,6 @@ #include "AppProcessChecker.h" #include "ContentChild.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsError.h" #include "nsIXPConnect.h" #include "jsapi.h" @@ -33,6 +32,7 @@ #include "mozilla/Preferences.h" #include "mozilla/dom/nsIContentParent.h" #include "mozilla/dom/PermissionMessageUtils.h" +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/StructuredCloneUtils.h" #include "mozilla/dom/PBlobChild.h" #include "mozilla/dom/PBlobParent.h" diff --git a/content/base/src/nsNodeUtils.cpp b/content/base/src/nsNodeUtils.cpp index 8ab312b511d..fb5441f7055 100644 --- a/content/base/src/nsNodeUtils.cpp +++ b/content/base/src/nsNodeUtils.cpp @@ -6,7 +6,6 @@ #include "nsNodeUtils.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsINode.h" #include "nsIContent.h" #include "mozilla/dom/Element.h" diff --git a/content/base/src/nsObjectLoadingContent.cpp b/content/base/src/nsObjectLoadingContent.cpp index fdcbfb59d28..c7a14d260c7 100644 --- a/content/base/src/nsObjectLoadingContent.cpp +++ b/content/base/src/nsObjectLoadingContent.cpp @@ -48,7 +48,6 @@ #include "nsCURILoader.h" #include "nsContentPolicyUtils.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsDocShellCID.h" #include "nsGkAtoms.h" #include "nsThreadUtils.h" diff --git a/content/base/src/nsScriptLoader.cpp b/content/base/src/nsScriptLoader.cpp index 03c6ad87d08..f82cbf0cd2f 100644 --- a/content/base/src/nsScriptLoader.cpp +++ b/content/base/src/nsScriptLoader.cpp @@ -33,7 +33,6 @@ #include "nsIDOMHTMLScriptElement.h" #include "nsIDocShell.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsUnicharUtils.h" #include "nsAutoPtr.h" #include "nsIXPConnect.h" diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index 877342fd4d3..554eb7279c1 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -41,7 +41,6 @@ #include "nsIStreamConverterService.h" #include "nsICachingChannel.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsCycleCollectionParticipant.h" #include "nsIContentPolicy.h" #include "nsContentPolicyUtils.h" diff --git a/dom/audiochannel/AudioChannelService.cpp b/dom/audiochannel/AudioChannelService.cpp index 99ab9d6c782..286cc3e8742 100644 --- a/dom/audiochannel/AudioChannelService.cpp +++ b/dom/audiochannel/AudioChannelService.cpp @@ -23,7 +23,6 @@ #ifdef MOZ_WIDGET_GONK #include "nsJSUtils.h" -#include "nsCxPusher.h" #include "nsIAudioManager.h" #include "SpeakerManagerService.h" #define NS_AUDIOMANAGER_CONTRACTID "@mozilla.org/telephony/audiomanager;1" diff --git a/dom/base/DOMRequest.cpp b/dom/base/DOMRequest.cpp index ae1391ada65..a6c21cb4770 100644 --- a/dom/base/DOMRequest.cpp +++ b/dom/base/DOMRequest.cpp @@ -7,7 +7,6 @@ #include "DOMRequest.h" #include "DOMError.h" -#include "nsCxPusher.h" #include "nsThreadUtils.h" #include "DOMCursor.h" #include "nsIDOMEvent.h" diff --git a/dom/base/ScriptSettings.cpp b/dom/base/ScriptSettings.cpp index edeb01f715d..8cbea9aed5b 100644 --- a/dom/base/ScriptSettings.cpp +++ b/dom/base/ScriptSettings.cpp @@ -20,6 +20,7 @@ #include "nsTArray.h" #include "nsJSUtils.h" #include "nsDOMJSUtils.h" +#include "WorkerPrivate.h" namespace mozilla { namespace dom { @@ -437,4 +438,91 @@ danger::AutoCxPusher::IsStackTop() const } } // namespace dom + +AutoJSContext::AutoJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL) + : mCx(nullptr) +{ + Init(false MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT); +} + +AutoJSContext::AutoJSContext(bool aSafe MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL) + : mCx(nullptr) +{ + Init(aSafe MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT); +} + +void +AutoJSContext::Init(bool aSafe MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL) +{ + JS::AutoSuppressGCAnalysis nogc; + MOZ_ASSERT(!mCx, "mCx should not be initialized!"); + + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + + nsXPConnect *xpc = nsXPConnect::XPConnect(); + if (!aSafe) { + mCx = xpc->GetCurrentJSContext(); + } + + if (!mCx) { + mCx = xpc->GetSafeJSContext(); + mPusher.emplace(mCx); + } +} + +AutoJSContext::operator JSContext*() const +{ + return mCx; +} + +ThreadsafeAutoJSContext::ThreadsafeAutoJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL) +{ + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + + if (NS_IsMainThread()) { + mCx = nullptr; + mAutoJSContext.emplace(); + } else { + mCx = mozilla::dom::workers::GetCurrentThreadJSContext(); + mRequest.emplace(mCx); + } +} + +ThreadsafeAutoJSContext::operator JSContext*() const +{ + if (mCx) { + return mCx; + } else { + return *mAutoJSContext; + } +} + +AutoSafeJSContext::AutoSafeJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL) + : AutoJSContext(true MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT) + , mAc(mCx, XPCJSRuntime::Get()->GetJSContextStack()->GetSafeJSContextGlobal()) +{ +} + +ThreadsafeAutoSafeJSContext::ThreadsafeAutoSafeJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL) +{ + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + + if (NS_IsMainThread()) { + mCx = nullptr; + mAutoSafeJSContext.emplace(); + } else { + mCx = mozilla::dom::workers::GetCurrentThreadJSContext(); + mRequest.emplace(mCx); + } +} + +ThreadsafeAutoSafeJSContext::operator JSContext*() const +{ + if (mCx) { + return mCx; + } else { + return *mAutoSafeJSContext; + } +} + } // namespace mozilla diff --git a/dom/base/ScriptSettings.h b/dom/base/ScriptSettings.h index 51be031b461..5e53cddea81 100644 --- a/dom/base/ScriptSettings.h +++ b/dom/base/ScriptSettings.h @@ -24,6 +24,7 @@ class nsIScriptContext; namespace mozilla { namespace dom { +// For internal use only - use AutoJSAPI instead. namespace danger { /** @@ -279,6 +280,75 @@ private: }; } // namespace dom + +/** + * Use AutoJSContext when you need a JS context on the stack but don't have one + * passed as a parameter. AutoJSContext will take care of finding the most + * appropriate JS context and release it when leaving the stack. + */ +class MOZ_STACK_CLASS AutoJSContext { +public: + explicit AutoJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM); + operator JSContext*() const; + +protected: + explicit AutoJSContext(bool aSafe MOZ_GUARD_OBJECT_NOTIFIER_PARAM); + + // We need this Init() method because we can't use delegating constructor for + // the moment. It is a C++11 feature and we do not require C++11 to be + // supported to be able to compile Gecko. + void Init(bool aSafe MOZ_GUARD_OBJECT_NOTIFIER_PARAM); + + JSContext* mCx; + Maybe mPusher; + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER +}; + +/** + * Use ThreadsafeAutoJSContext when you want an AutoJSContext but might be + * running on a worker thread. + */ +class MOZ_STACK_CLASS ThreadsafeAutoJSContext { +public: + explicit ThreadsafeAutoJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM); + operator JSContext*() const; + +private: + JSContext* mCx; // Used on workers. Null means mainthread. + Maybe mRequest; // Used on workers. + Maybe mAutoJSContext; // Used on main thread. + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER +}; + +/** + * AutoSafeJSContext is similar to AutoJSContext but will only return the safe + * JS context. That means it will never call nsContentUtils::GetCurrentJSContext(). + * + * Note - This is deprecated. Please use AutoJSAPI instead. + */ +class MOZ_STACK_CLASS AutoSafeJSContext : public AutoJSContext { +public: + explicit AutoSafeJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM); +private: + JSAutoCompartment mAc; +}; + +/** + * Like AutoSafeJSContext but can be used safely on worker threads. + */ +class MOZ_STACK_CLASS ThreadsafeAutoSafeJSContext { +public: + explicit ThreadsafeAutoSafeJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM); + operator JSContext*() const; + +private: + JSContext* mCx; // Used on workers. Null means mainthread. + Maybe mRequest; // Used on workers. + Maybe mAutoSafeJSContext; // Used on main thread. + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER +}; + + } // namespace mozilla #endif // mozilla_dom_ScriptSettings_h diff --git a/dom/base/nsContentPermissionHelper.cpp b/dom/base/nsContentPermissionHelper.cpp index 98e6ee2fba5..4d955b6dadf 100644 --- a/dom/base/nsContentPermissionHelper.cpp +++ b/dom/base/nsContentPermissionHelper.cpp @@ -21,7 +21,6 @@ #include "nsArrayUtils.h" #include "nsIMutableArray.h" #include "nsContentPermissionHelper.h" -#include "nsCxPusher.h" #include "nsJSUtils.h" #include "nsISupportsPrimitives.h" #include "nsServiceManagerUtils.h" diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index d851b683ace..ac70ca637e6 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -48,7 +48,6 @@ #include "nsIDOMEvent.h" #include "nsIDOMEventListener.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsIDOMGlobalPropertyInitializer.h" #include "mozilla/Attributes.h" #include "mozilla/Telemetry.h" diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index d3f6cd9ccea..62cfef6397a 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -119,7 +119,6 @@ #include "nsGlobalWindowCommands.h" #include "nsAutoPtr.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsCSSProps.h" #include "nsIDOMFile.h" #include "nsIDOMFileList.h" diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index bc710cd4aa7..7ae1c32bb6d 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -31,7 +31,6 @@ #include "nsITimer.h" #include "nsIAtom.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "mozilla/EventDispatcher.h" #include "nsIContent.h" #include "nsCycleCollector.h" diff --git a/dom/bindings/CallbackObject.cpp b/dom/bindings/CallbackObject.cpp index b2681a3e81a..a2c92d5305c 100644 --- a/dom/bindings/CallbackObject.cpp +++ b/dom/bindings/CallbackObject.cpp @@ -14,7 +14,6 @@ #include "nsIScriptContext.h" #include "nsPIDOMWindow.h" #include "nsJSUtils.h" -#include "nsCxPusher.h" #include "nsIScriptSecurityManager.h" #include "xpcprivate.h" #include "WorkerPrivate.h" diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 1374de7ca79..6ae351b4aff 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -11831,7 +11831,6 @@ class CGBindingRoot(CGThing): bindingHeaders["nsThreadUtils.h"] = hasWorkerStuff dictionaries = config.getDictionaries(webIDLFile=webIDLFile) - bindingHeaders["nsCxPusher.h"] = dictionaries hasNonEmptyDictionaries = any( len(dict.members) > 0 for dict in dictionaries) mainCallbacks = config.getCallbacks(webIDLFile=webIDLFile, diff --git a/dom/bluetooth/BluetoothReplyRunnable.cpp b/dom/bluetooth/BluetoothReplyRunnable.cpp index a8fe77632a9..d2e2f3771b9 100644 --- a/dom/bluetooth/BluetoothReplyRunnable.cpp +++ b/dom/bluetooth/BluetoothReplyRunnable.cpp @@ -7,6 +7,7 @@ #include "base/basictypes.h" #include "BluetoothReplyRunnable.h" #include "DOMRequest.h" +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/bluetooth/BluetoothTypes.h" #include "nsServiceManagerUtils.h" diff --git a/dom/bluetooth/BluetoothService.cpp b/dom/bluetooth/BluetoothService.cpp index 4b95ffd965a..4784ae3608b 100644 --- a/dom/bluetooth/BluetoothService.cpp +++ b/dom/bluetooth/BluetoothService.cpp @@ -28,7 +28,6 @@ #include "mozilla/dom/bluetooth/BluetoothTypes.h" #include "mozilla/ipc/UnixSocket.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsIObserverService.h" #include "nsISettingsService.h" #include "nsISystemMessagesInternal.h" diff --git a/dom/bluetooth/bluedroid/BluetoothUtils.cpp b/dom/bluetooth/bluedroid/BluetoothUtils.cpp index c89efef54f8..7853ebf098e 100644 --- a/dom/bluetooth/bluedroid/BluetoothUtils.cpp +++ b/dom/bluetooth/bluedroid/BluetoothUtils.cpp @@ -14,7 +14,6 @@ #include "mozilla/Scoped.h" #include "mozilla/dom/bluetooth/BluetoothTypes.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsIScriptContext.h" #include "nsISystemMessagesInternal.h" #include "nsString.h" diff --git a/dom/bluetooth/bluez/BluetoothUtils.cpp b/dom/bluetooth/bluez/BluetoothUtils.cpp index d9bd896fb2b..d4120082d9e 100644 --- a/dom/bluetooth/bluez/BluetoothUtils.cpp +++ b/dom/bluetooth/bluez/BluetoothUtils.cpp @@ -13,7 +13,6 @@ #include "mozilla/Scoped.h" #include "mozilla/dom/bluetooth/BluetoothTypes.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsIScriptContext.h" #include "nsISystemMessagesInternal.h" #include "nsString.h" diff --git a/dom/bluetooth2/BluetoothReplyRunnable.cpp b/dom/bluetooth2/BluetoothReplyRunnable.cpp index d1ede83d464..a381aaa8935 100644 --- a/dom/bluetooth2/BluetoothReplyRunnable.cpp +++ b/dom/bluetooth2/BluetoothReplyRunnable.cpp @@ -7,6 +7,7 @@ #include "base/basictypes.h" #include "BluetoothReplyRunnable.h" #include "DOMRequest.h" +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/bluetooth/BluetoothTypes.h" #include "mozilla/dom/Promise.h" #include "nsServiceManagerUtils.h" diff --git a/dom/bluetooth2/BluetoothService.cpp b/dom/bluetooth2/BluetoothService.cpp index 5cafeb0a430..428c7c1f25c 100644 --- a/dom/bluetooth2/BluetoothService.cpp +++ b/dom/bluetooth2/BluetoothService.cpp @@ -27,7 +27,6 @@ #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/bluetooth/BluetoothTypes.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsIObserverService.h" #include "nsISettingsService.h" #include "nsISystemMessagesInternal.h" diff --git a/dom/bluetooth2/bluedroid/BluetoothUtils.cpp b/dom/bluetooth2/bluedroid/BluetoothUtils.cpp index d4432660ca7..063ca036550 100644 --- a/dom/bluetooth2/bluedroid/BluetoothUtils.cpp +++ b/dom/bluetooth2/bluedroid/BluetoothUtils.cpp @@ -12,9 +12,9 @@ #include "BluetoothUtils.h" #include "jsapi.h" #include "mozilla/Scoped.h" +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/bluetooth/BluetoothTypes.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsIScriptContext.h" #include "nsISystemMessagesInternal.h" #include "nsString.h" diff --git a/dom/bluetooth2/bluez/BluetoothUtils.cpp b/dom/bluetooth2/bluez/BluetoothUtils.cpp index d9bd896fb2b..d4bc173db6e 100644 --- a/dom/bluetooth2/bluez/BluetoothUtils.cpp +++ b/dom/bluetooth2/bluez/BluetoothUtils.cpp @@ -11,9 +11,9 @@ #include "BluetoothUtils.h" #include "jsapi.h" #include "mozilla/Scoped.h" +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/bluetooth/BluetoothTypes.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsIScriptContext.h" #include "nsISystemMessagesInternal.h" #include "nsString.h" diff --git a/dom/browser-element/BrowserElementParent.cpp b/dom/browser-element/BrowserElementParent.cpp index d2a123a4cea..586d481ade9 100644 --- a/dom/browser-element/BrowserElementParent.cpp +++ b/dom/browser-element/BrowserElementParent.cpp @@ -19,7 +19,6 @@ #include "nsIInterfaceRequestorUtils.h" #include "nsVariant.h" #include "mozilla/dom/BrowserElementDictionariesBinding.h" -#include "nsCxPusher.h" #include "mozilla/dom/CustomEvent.h" using namespace mozilla; diff --git a/dom/canvas/WebGLContextUtils.cpp b/dom/canvas/WebGLContextUtils.cpp index 545a6220046..657230d422d 100644 --- a/dom/canvas/WebGLContextUtils.cpp +++ b/dom/canvas/WebGLContextUtils.cpp @@ -10,7 +10,6 @@ #include "GLContext.h" #include "jsapi.h" #include "mozilla/Preferences.h" -#include "nsCxPusher.h" #include "nsIDOMDataContainerEvent.h" #include "nsIDOMEvent.h" #include "nsIScriptSecurityManager.h" @@ -24,6 +23,8 @@ #include "WebGLTexture.h" #include "WebGLVertexArray.h" +#include "mozilla/dom/ScriptSettings.h" + namespace mozilla { using namespace gl; diff --git a/dom/devicestorage/nsDeviceStorage.cpp b/dom/devicestorage/nsDeviceStorage.cpp index f3e66cbeb77..1147ebd3f8b 100644 --- a/dom/devicestorage/nsDeviceStorage.cpp +++ b/dom/devicestorage/nsDeviceStorage.cpp @@ -43,7 +43,6 @@ #include "nsIPrincipal.h" #include "nsJSUtils.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsXULAppAPI.h" #include "DeviceStorageFileDescriptor.h" #include "DeviceStorageRequestChild.h" diff --git a/dom/events/EventListenerService.cpp b/dom/events/EventListenerService.cpp index 4a4ded4017b..a0cc99ca5c5 100644 --- a/dom/events/EventListenerService.cpp +++ b/dom/events/EventListenerService.cpp @@ -10,7 +10,6 @@ #include "mozilla/JSEventHandler.h" #include "mozilla/Maybe.h" #include "nsCOMArray.h" -#include "nsCxPusher.h" #include "nsDOMClassInfoID.h" #include "nsIXPConnect.h" #include "nsJSUtils.h" diff --git a/dom/fmradio/FMRadioService.cpp b/dom/fmradio/FMRadioService.cpp index f37bbd7bf70..d6885eebd6d 100644 --- a/dom/fmradio/FMRadioService.cpp +++ b/dom/fmradio/FMRadioService.cpp @@ -12,10 +12,10 @@ #include "nsDOMClassInfo.h" #include "mozilla/Preferences.h" #include "mozilla/dom/FMRadioChild.h" +#include "mozilla/dom/ScriptSettings.h" #include "nsIObserverService.h" #include "nsISettingsService.h" #include "nsJSUtils.h" -#include "nsCxPusher.h" #define BAND_87500_108000_kHz 1 #define BAND_76000_108000_kHz 2 diff --git a/dom/indexedDB/IDBFactory.cpp b/dom/indexedDB/IDBFactory.cpp index 1f890665adb..a17ce5d1f86 100644 --- a/dom/indexedDB/IDBFactory.cpp +++ b/dom/indexedDB/IDBFactory.cpp @@ -26,7 +26,6 @@ #include "nsComponentManagerUtils.h" #include "nsCharSeparatedTokenizer.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsDOMClassInfoID.h" #include "nsGlobalWindow.h" #include "nsHashKeys.h" diff --git a/dom/indexedDB/IDBFileRequest.cpp b/dom/indexedDB/IDBFileRequest.cpp index d470b2830b5..d774df24aaa 100644 --- a/dom/indexedDB/IDBFileRequest.cpp +++ b/dom/indexedDB/IDBFileRequest.cpp @@ -16,7 +16,6 @@ #include "mozilla/dom/ProgressEvent.h" #include "mozilla/EventDispatcher.h" #include "nsCOMPtr.h" -#include "nsCxPusher.h" #include "nsDebug.h" #include "nsError.h" #include "nsIDOMEvent.h" diff --git a/dom/indexedDB/IDBRequest.cpp b/dom/indexedDB/IDBRequest.cpp index 2a813a4fb76..e778a4bfdee 100644 --- a/dom/indexedDB/IDBRequest.cpp +++ b/dom/indexedDB/IDBRequest.cpp @@ -18,7 +18,6 @@ #include "nsDOMClassInfoID.h" #include "nsDOMJSUtils.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsJSUtils.h" #include "nsPIDOMWindow.h" #include "nsString.h" diff --git a/dom/indexedDB/ipc/IndexedDBParent.cpp b/dom/indexedDB/ipc/IndexedDBParent.cpp index 20ff78ec0d6..c5f4f265886 100644 --- a/dom/indexedDB/ipc/IndexedDBParent.cpp +++ b/dom/indexedDB/ipc/IndexedDBParent.cpp @@ -17,7 +17,6 @@ #include "mozilla/dom/ipc/Blob.h" #include "mozilla/dom/TabParent.h" #include "mozilla/unused.h" -#include "nsCxPusher.h" #include "AsyncConnectionHelper.h" #include "DatabaseInfo.h" diff --git a/dom/ipc/PreallocatedProcessManager.cpp b/dom/ipc/PreallocatedProcessManager.cpp index c74d1c6fe35..ea0ab9bbee6 100644 --- a/dom/ipc/PreallocatedProcessManager.cpp +++ b/dom/ipc/PreallocatedProcessManager.cpp @@ -8,10 +8,10 @@ #include "mozilla/ClearOnShutdown.h" #include "mozilla/Preferences.h" #include "mozilla/dom/ContentParent.h" +#include "mozilla/dom/ScriptSettings.h" #include "nsIPropertyBag2.h" #include "ProcessPriorityManager.h" #include "nsServiceManagerUtils.h" -#include "nsCxPusher.h" #ifdef MOZ_NUWA_PROCESS #include "ipc/Nuwa.h" diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 9ebf11d0d68..512209f3a68 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -34,7 +34,6 @@ #include "mozilla/unused.h" #include "mozIApplication.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsEmbedCID.h" #include #ifdef MOZ_CRASHREPORTER diff --git a/dom/media/GetUserMediaRequest.cpp b/dom/media/GetUserMediaRequest.cpp index f0e8b9ca58a..d884ac828d6 100644 --- a/dom/media/GetUserMediaRequest.cpp +++ b/dom/media/GetUserMediaRequest.cpp @@ -8,7 +8,6 @@ #include "mozilla/dom/GetUserMediaRequestBinding.h" #include "nsIScriptGlobalObject.h" #include "nsPIDOMWindow.h" -#include "nsCxPusher.h" namespace mozilla { namespace dom { diff --git a/dom/media/MediaPermissionGonk.cpp b/dom/media/MediaPermissionGonk.cpp index 2f4a78ff1de..83d35e641fa 100644 --- a/dom/media/MediaPermissionGonk.cpp +++ b/dom/media/MediaPermissionGonk.cpp @@ -6,7 +6,6 @@ #include "MediaPermissionGonk.h" #include "nsCOMPtr.h" -#include "nsCxPusher.h" #include "nsIContentPermissionPrompt.h" #include "nsIDocument.h" #include "nsIDOMNavigatorUserMedia.h" diff --git a/dom/mobileconnection/src/MobileConnectionInfo.cpp b/dom/mobileconnection/src/MobileConnectionInfo.cpp index b9ad84f25cc..1b8803d26b1 100644 --- a/dom/mobileconnection/src/MobileConnectionInfo.cpp +++ b/dom/mobileconnection/src/MobileConnectionInfo.cpp @@ -6,8 +6,9 @@ #include "MobileConnectionInfo.h" +#include "mozilla/dom/ScriptSettings.h" + #include "jsapi.h" -#include "nsCxPusher.h" #define CONVERT_STRING_TO_NULLABLE_ENUM(_string, _enumType, _enum) \ { \ diff --git a/dom/mobilemessage/src/MmsMessage.cpp b/dom/mobilemessage/src/MmsMessage.cpp index ab8c588245b..c62d017d325 100644 --- a/dom/mobilemessage/src/MmsMessage.cpp +++ b/dom/mobilemessage/src/MmsMessage.cpp @@ -14,9 +14,9 @@ #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/mobilemessage/Constants.h" // For MessageType #include "mozilla/dom/mobilemessage/SmsTypes.h" +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/ToJSValue.h" #include "nsDOMFile.h" -#include "nsCxPusher.h" using namespace mozilla::dom::mobilemessage; diff --git a/dom/mobilemessage/src/MobileMessageCallback.cpp b/dom/mobilemessage/src/MobileMessageCallback.cpp index 9d9f9122779..981e80641ad 100644 --- a/dom/mobilemessage/src/MobileMessageCallback.cpp +++ b/dom/mobilemessage/src/MobileMessageCallback.cpp @@ -6,7 +6,6 @@ #include "MobileMessageCallback.h" #include "mozilla/dom/ToJSValue.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsIDOMMozSmsMessage.h" #include "nsIDOMMozMmsMessage.h" #include "nsIScriptGlobalObject.h" diff --git a/dom/mobilemessage/src/ipc/SmsIPCService.cpp b/dom/mobilemessage/src/ipc/SmsIPCService.cpp index cdca5b39245..83f2931947c 100644 --- a/dom/mobilemessage/src/ipc/SmsIPCService.cpp +++ b/dom/mobilemessage/src/ipc/SmsIPCService.cpp @@ -10,7 +10,6 @@ #include "SmsMessage.h" #include "SmsFilter.h" #include "nsJSUtils.h" -#include "nsCxPusher.h" #include "mozilla/dom/MozMobileMessageManagerBinding.h" #include "mozilla/dom/BindingUtils.h" #include "mozilla/Preferences.h" diff --git a/dom/mobilemessage/src/ipc/SmsParent.cpp b/dom/mobilemessage/src/ipc/SmsParent.cpp index 20d136797c7..987d74ea0fd 100644 --- a/dom/mobilemessage/src/ipc/SmsParent.cpp +++ b/dom/mobilemessage/src/ipc/SmsParent.cpp @@ -22,7 +22,6 @@ #include "mozilla/dom/mobilemessage/Constants.h" // For MessageType #include "nsContentUtils.h" #include "nsTArrayHelpers.h" -#include "nsCxPusher.h" #include "xpcpublic.h" #include "nsServiceManagerUtils.h" #include "DeletedMessageInfo.h" diff --git a/dom/network/src/TCPSocketParent.cpp b/dom/network/src/TCPSocketParent.cpp index af306d776ab..e9de185ce13 100644 --- a/dom/network/src/TCPSocketParent.cpp +++ b/dom/network/src/TCPSocketParent.cpp @@ -7,12 +7,12 @@ #include "jsfriendapi.h" #include "nsJSUtils.h" #include "nsIDOMTCPSocket.h" -#include "nsCxPusher.h" #include "mozilla/unused.h" #include "mozilla/AppProcessChecker.h" #include "mozilla/net/NeckoCommon.h" #include "mozilla/net/PNeckoParent.h" #include "mozilla/dom/ContentParent.h" +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/TabParent.h" #include "nsIScriptSecurityManager.h" diff --git a/dom/nfc/gonk/NfcService.cpp b/dom/nfc/gonk/NfcService.cpp index 02ed8d611b5..17bef26571f 100644 --- a/dom/nfc/gonk/NfcService.cpp +++ b/dom/nfc/gonk/NfcService.cpp @@ -9,7 +9,6 @@ #include "mozilla/dom/ToJSValue.h" #include "mozilla/dom/RootedDictionary.h" #include "nsAutoPtr.h" -#include "nsCxPusher.h" #include "nsString.h" #include "nsXULAppAPI.h" #include "NfcOptions.h" diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index 375f9364b2d..0833c4cd69c 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -17,7 +17,6 @@ #include "nsIScriptContext.h" #include "nsDOMJSUtils.h" #include "nsJSUtils.h" -#include "nsCxPusher.h" #include "nsIDocument.h" #include "nsIJSRuntimeService.h" #include "nsIXPConnect.h" diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp index d955254d280..0455b86d619 100644 --- a/dom/plugins/base/nsNPAPIPlugin.cpp +++ b/dom/plugins/base/nsNPAPIPlugin.cpp @@ -40,7 +40,6 @@ #include "nsIPrincipal.h" #include "nsWildCard.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "mozilla/dom/ScriptSettings.h" #include "nsIXPConnect.h" diff --git a/dom/plugins/base/nsNPAPIPlugin.h b/dom/plugins/base/nsNPAPIPlugin.h index c5ba6d9c814..29edc92b0db 100644 --- a/dom/plugins/base/nsNPAPIPlugin.h +++ b/dom/plugins/base/nsNPAPIPlugin.h @@ -10,8 +10,7 @@ #include "npfunctions.h" #include "nsPluginHost.h" -#include "nsCxPusher.h" - +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/PluginLibrary.h" #if defined(XP_WIN) diff --git a/dom/plugins/ipc/PluginIdentifierParent.cpp b/dom/plugins/ipc/PluginIdentifierParent.cpp index afdeb81aaa9..137162c59a9 100644 --- a/dom/plugins/ipc/PluginIdentifierParent.cpp +++ b/dom/plugins/ipc/PluginIdentifierParent.cpp @@ -9,7 +9,6 @@ #include "nsNPAPIPlugin.h" #include "nsServiceManagerUtils.h" #include "PluginScriptableObjectUtils.h" -#include "nsCxPusher.h" #include "mozilla/unused.h" using namespace mozilla::plugins::parent; diff --git a/dom/plugins/ipc/PluginScriptableObjectParent.cpp b/dom/plugins/ipc/PluginScriptableObjectParent.cpp index 5d55b1df53f..baea05c1715 100644 --- a/dom/plugins/ipc/PluginScriptableObjectParent.cpp +++ b/dom/plugins/ipc/PluginScriptableObjectParent.cpp @@ -9,7 +9,6 @@ #include "mozilla/DebugOnly.h" #include "mozilla/plugins/PluginIdentifierParent.h" #include "mozilla/unused.h" -#include "nsCxPusher.h" #include "nsNPAPIPlugin.h" #include "PluginScriptableObjectUtils.h" diff --git a/dom/src/jsurl/nsJSProtocolHandler.cpp b/dom/src/jsurl/nsJSProtocolHandler.cpp index 0ce5193cb4d..06ad830f7a6 100644 --- a/dom/src/jsurl/nsJSProtocolHandler.cpp +++ b/dom/src/jsurl/nsJSProtocolHandler.cpp @@ -36,7 +36,6 @@ #include "nsIContentViewer.h" #include "nsIXPConnect.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsJSUtils.h" #include "nsThreadUtils.h" #include "nsIScriptChannel.h" diff --git a/dom/system/gonk/AudioManager.cpp b/dom/system/gonk/AudioManager.cpp index a4a2ceead67..82517df7a7e 100644 --- a/dom/system/gonk/AudioManager.cpp +++ b/dom/system/gonk/AudioManager.cpp @@ -30,13 +30,13 @@ #include "mozilla/Services.h" #include "mozilla/StaticPtr.h" #include "mozilla/ClearOnShutdown.h" +#include "mozilla/dom/ScriptSettings.h" #include "base/message_loop.h" #include "BluetoothCommon.h" #include "BluetoothHfpManagerBase.h" #include "nsJSUtils.h" -#include "nsCxPusher.h" #include "nsThreadUtils.h" #include "nsServiceManagerUtils.h" #include "nsComponentManagerUtils.h" diff --git a/dom/system/gonk/AutoMounterSetting.cpp b/dom/system/gonk/AutoMounterSetting.cpp index d6e4637a1b7..876a756b02b 100644 --- a/dom/system/gonk/AutoMounterSetting.cpp +++ b/dom/system/gonk/AutoMounterSetting.cpp @@ -11,7 +11,6 @@ #include "nsCOMPtr.h" #include "nsDebug.h" #include "nsIObserverService.h" -#include "nsCxPusher.h" #include "nsISettingsService.h" #include "nsJSUtils.h" #include "nsPrintfCString.h" @@ -19,6 +18,7 @@ #include "nsString.h" #include "nsThreadUtils.h" #include "xpcpublic.h" +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/Attributes.h" #undef LOG diff --git a/dom/system/gonk/NetworkWorker.cpp b/dom/system/gonk/NetworkWorker.cpp index fa4769ef4c6..b848c406736 100644 --- a/dom/system/gonk/NetworkWorker.cpp +++ b/dom/system/gonk/NetworkWorker.cpp @@ -7,9 +7,9 @@ #include #include "mozilla/ModuleUtils.h" #include "mozilla/ClearOnShutdown.h" +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/ToJSValue.h" #include "nsXULAppAPI.h" -#include "nsCxPusher.h" #define NS_NETWORKWORKER_CID \ { 0x6df093e1, 0x8127, 0x4fa7, {0x90, 0x13, 0xa3, 0xaa, 0xa7, 0x79, 0xbb, 0xdd} } diff --git a/dom/system/gonk/SystemWorkerManager.cpp b/dom/system/gonk/SystemWorkerManager.cpp index 9d157370292..7332817662d 100644 --- a/dom/system/gonk/SystemWorkerManager.cpp +++ b/dom/system/gonk/SystemWorkerManager.cpp @@ -27,12 +27,12 @@ #include "AutoMounter.h" #include "TimeZoneSettingObserver.h" #include "AudioManager.h" +#include "mozilla/dom/ScriptSettings.h" #ifdef MOZ_B2G_RIL #include "mozilla/ipc/Ril.h" #endif #include "mozilla/ipc/KeyStore.h" #include "nsIObserverService.h" -#include "nsCxPusher.h" #include "nsServiceManagerUtils.h" #include "nsThreadUtils.h" #include "nsRadioInterfaceLayer.h" diff --git a/dom/system/gonk/TimeZoneSettingObserver.cpp b/dom/system/gonk/TimeZoneSettingObserver.cpp index 3db33a9e343..18306e7e0d2 100644 --- a/dom/system/gonk/TimeZoneSettingObserver.cpp +++ b/dom/system/gonk/TimeZoneSettingObserver.cpp @@ -4,6 +4,7 @@ #include "base/message_loop.h" #include "jsapi.h" +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/Attributes.h" #include "mozilla/ClearOnShutdown.h" #include "mozilla/Hal.h" @@ -20,7 +21,6 @@ #include "TimeZoneSettingObserver.h" #include "xpcpublic.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsPrintfCString.h" #undef LOG diff --git a/dom/telephony/Telephony.cpp b/dom/telephony/Telephony.cpp index d947b88dbbf..2a63cb4e697 100644 --- a/dom/telephony/Telephony.cpp +++ b/dom/telephony/Telephony.cpp @@ -17,7 +17,6 @@ #include "mozilla/Preferences.h" #include "nsCharSeparatedTokenizer.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsNetUtil.h" #include "nsServiceManagerUtils.h" #include "nsThreadUtils.h" diff --git a/dom/time/DateCacheCleaner.cpp b/dom/time/DateCacheCleaner.cpp index 5be69faf88a..a976ef4ea3b 100644 --- a/dom/time/DateCacheCleaner.cpp +++ b/dom/time/DateCacheCleaner.cpp @@ -6,10 +6,10 @@ #include "DateCacheCleaner.h" #include "jsapi.h" +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/ClearOnShutdown.h" #include "mozilla/Hal.h" #include "mozilla/StaticPtr.h" -#include "nsCxPusher.h" using namespace mozilla::hal; diff --git a/dom/wifi/WifiCertService.cpp b/dom/wifi/WifiCertService.cpp index cfc0910dc2a..23bca42f24e 100644 --- a/dom/wifi/WifiCertService.cpp +++ b/dom/wifi/WifiCertService.cpp @@ -16,7 +16,6 @@ #include "cert.h" #include "certdb.h" #include "CryptoTask.h" -#include "nsCxPusher.h" #include "nsIDOMFile.h" #include "nsIWifiService.h" #include "nsNetUtil.h" diff --git a/dom/wifi/WifiProxyService.cpp b/dom/wifi/WifiProxyService.cpp index 78bc7076a20..113c6fcb2b7 100644 --- a/dom/wifi/WifiProxyService.cpp +++ b/dom/wifi/WifiProxyService.cpp @@ -9,7 +9,6 @@ #include "mozilla/dom/ToJSValue.h" #include "nsXULAppAPI.h" #include "WifiUtils.h" -#include "nsCxPusher.h" #ifdef MOZ_TASK_TRACER #include "GeckoTaskTracer.h" diff --git a/dom/wifi/WifiUtils.h b/dom/wifi/WifiUtils.h index 41e20f1b0a1..7aacf6935ed 100644 --- a/dom/wifi/WifiUtils.h +++ b/dom/wifi/WifiUtils.h @@ -15,7 +15,6 @@ #include "mozilla/dom/WifiOptionsBinding.h" #include "mozilla/dom/network/NetUtils.h" #include "WifiHotspotUtils.h" -#include "nsCxPusher.h" // Needed to add a copy constructor to WifiCommandOptions. struct CommandOptions diff --git a/dom/workers/ServiceWorkerManager.cpp b/dom/workers/ServiceWorkerManager.cpp index 6b9a5454cb7..97282f4982a 100644 --- a/dom/workers/ServiceWorkerManager.cpp +++ b/dom/workers/ServiceWorkerManager.cpp @@ -18,7 +18,6 @@ #include "mozilla/dom/PromiseNativeHandler.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsNetUtil.h" #include "nsProxyRelease.h" #include "nsTArray.h" diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 26cd35fe473..c5ca440f22c 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -53,7 +53,6 @@ #include "mozilla/Preferences.h" #include "nsAlgorithm.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsError.h" #include "nsDOMJSUtils.h" #include "nsHostObjectProtocolHandler.h" diff --git a/dom/workers/XMLHttpRequest.cpp b/dom/workers/XMLHttpRequest.cpp index 9db5f6908b8..111d3046b09 100644 --- a/dom/workers/XMLHttpRequest.cpp +++ b/dom/workers/XMLHttpRequest.cpp @@ -18,7 +18,6 @@ #include "mozilla/dom/ProgressEvent.h" #include "nsComponentManagerUtils.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsJSUtils.h" #include "nsThreadUtils.h" diff --git a/dom/xbl/nsXBLDocumentInfo.cpp b/dom/xbl/nsXBLDocumentInfo.cpp index 851dfb70f28..3931f8666ac 100644 --- a/dom/xbl/nsXBLDocumentInfo.cpp +++ b/dom/xbl/nsXBLDocumentInfo.cpp @@ -23,7 +23,6 @@ #include "nsJSPrincipals.h" #include "nsIScriptSecurityManager.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsDOMJSUtils.h" #include "mozilla/Services.h" #include "xpcpublic.h" diff --git a/dom/xbl/nsXBLProtoImpl.cpp b/dom/xbl/nsXBLProtoImpl.cpp index e18fbd2ce14..56020202600 100644 --- a/dom/xbl/nsXBLProtoImpl.cpp +++ b/dom/xbl/nsXBLProtoImpl.cpp @@ -9,7 +9,6 @@ #include "nsIContent.h" #include "nsIDocument.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsIXPConnect.h" #include "nsIServiceManager.h" #include "nsIDOMNode.h" diff --git a/dom/xbl/nsXBLProtoImplMethod.cpp b/dom/xbl/nsXBLProtoImplMethod.cpp index 437d844fe7c..798d07eeb6e 100644 --- a/dom/xbl/nsXBLProtoImplMethod.cpp +++ b/dom/xbl/nsXBLProtoImplMethod.cpp @@ -14,7 +14,6 @@ #include "nsXBLProtoImplMethod.h" #include "nsJSUtils.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsIScriptSecurityManager.h" #include "nsIXPConnect.h" #include "xpcpublic.h" diff --git a/dom/xbl/nsXBLProtoImplProperty.cpp b/dom/xbl/nsXBLProtoImplProperty.cpp index eaa8e672dca..295f63db05c 100644 --- a/dom/xbl/nsXBLProtoImplProperty.cpp +++ b/dom/xbl/nsXBLProtoImplProperty.cpp @@ -9,7 +9,6 @@ #include "nsIContent.h" #include "nsXBLProtoImplProperty.h" #include "nsUnicharUtils.h" -#include "nsCxPusher.h" #include "nsReadableUtils.h" #include "nsJSUtils.h" #include "nsXBLPrototypeBinding.h" diff --git a/dom/xbl/nsXBLPrototypeHandler.cpp b/dom/xbl/nsXBLPrototypeHandler.cpp index 1663738cfff..01df4b48c79 100644 --- a/dom/xbl/nsXBLPrototypeHandler.cpp +++ b/dom/xbl/nsXBLPrototypeHandler.cpp @@ -9,7 +9,6 @@ #include "nsXBLPrototypeHandler.h" #include "nsXBLPrototypeBinding.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsGlobalWindow.h" #include "nsIContent.h" #include "nsIAtom.h" diff --git a/dom/xbl/nsXBLSerialize.cpp b/dom/xbl/nsXBLSerialize.cpp index d57e13573b0..d29f987cfed 100644 --- a/dom/xbl/nsXBLSerialize.cpp +++ b/dom/xbl/nsXBLSerialize.cpp @@ -10,7 +10,6 @@ #include "nsXBLPrototypeBinding.h" #include "nsIXPConnect.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" using namespace mozilla; diff --git a/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp b/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp index 99287dad61e..904cf531482 100644 --- a/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp +++ b/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp @@ -19,7 +19,6 @@ #include "mozilla/Attributes.h" #include "mozilla/Maybe.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsIScriptSecurityManager.h" #include "nsJSPrincipals.h" #include "jswrapper.h" diff --git a/ipc/testshell/XPCShellEnvironment.cpp b/ipc/testshell/XPCShellEnvironment.cpp index 238707ff3e4..921e120e6d5 100644 --- a/ipc/testshell/XPCShellEnvironment.cpp +++ b/ipc/testshell/XPCShellEnvironment.cpp @@ -33,7 +33,6 @@ #include "nsIXPConnect.h" #include "nsIXPCScriptable.h" -#include "nsCxPusher.h" #include "nsJSUtils.h" #include "nsJSPrincipals.h" #include "nsThreadUtils.h" diff --git a/js/ipc/JavaScriptChild.cpp b/js/ipc/JavaScriptChild.cpp index a8d65997637..02c93647184 100644 --- a/js/ipc/JavaScriptChild.cpp +++ b/js/ipc/JavaScriptChild.cpp @@ -12,7 +12,6 @@ #include "nsContentUtils.h" #include "xpcprivate.h" #include "jsfriendapi.h" -#include "nsCxPusher.h" #include "AccessCheck.h" using namespace JS; diff --git a/js/ipc/WrapperAnswer.cpp b/js/ipc/WrapperAnswer.cpp index db8c7b11e5e..7ad31f7607d 100644 --- a/js/ipc/WrapperAnswer.cpp +++ b/js/ipc/WrapperAnswer.cpp @@ -12,7 +12,6 @@ #include "nsContentUtils.h" #include "xpcprivate.h" #include "jsfriendapi.h" -#include "nsCxPusher.h" using namespace JS; using namespace mozilla; diff --git a/js/xpconnect/loader/mozJSComponentLoader.h b/js/xpconnect/loader/mozJSComponentLoader.h index 67f55352e60..fcd02fb6339 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.h +++ b/js/xpconnect/loader/mozJSComponentLoader.h @@ -7,6 +7,7 @@ #ifndef mozJSComponentLoader_h #define mozJSComponentLoader_h +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/MemoryReporting.h" #include "mozilla/ModuleLoader.h" #include "nsISupports.h" @@ -14,7 +15,6 @@ #include "nsIURI.h" #include "xpcIJSModuleLoader.h" #include "nsClassHashtable.h" -#include "nsCxPusher.h" #include "nsDataHashtable.h" #include "jsapi.h" diff --git a/js/xpconnect/src/Sandbox.cpp b/js/xpconnect/src/Sandbox.cpp index 513c284d2e9..9eaa4d53038 100644 --- a/js/xpconnect/src/Sandbox.cpp +++ b/js/xpconnect/src/Sandbox.cpp @@ -14,7 +14,6 @@ #include "js/OldDebugAPI.h" #include "js/StructuredClone.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsGlobalWindow.h" #include "nsIScriptContext.h" #include "nsIScriptObjectPrincipal.h" diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index 45d1beeaf85..bf8f372fc0a 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -29,7 +29,6 @@ #include "mozilla/Services.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include "nsCCUncollectableMarker.h" #include "nsCycleCollectionNoteRootCallback.h" #include "nsScriptLoader.h" diff --git a/js/xpconnect/src/XPCVariant.cpp b/js/xpconnect/src/XPCVariant.cpp index 245c56225ad..89e679f9740 100644 --- a/js/xpconnect/src/XPCVariant.cpp +++ b/js/xpconnect/src/XPCVariant.cpp @@ -9,7 +9,6 @@ #include "mozilla/Range.h" #include "xpcprivate.h" -#include "nsCxPusher.h" #include "jsfriendapi.h" #include "jsprf.h" diff --git a/js/xpconnect/src/XPCWrappedJS.cpp b/js/xpconnect/src/XPCWrappedJS.cpp index 20b4d7579ae..1835bbfed17 100644 --- a/js/xpconnect/src/XPCWrappedJS.cpp +++ b/js/xpconnect/src/XPCWrappedJS.cpp @@ -9,7 +9,6 @@ #include "xpcprivate.h" #include "jsprf.h" #include "nsCCUncollectableMarker.h" -#include "nsCxPusher.h" #include "nsContentUtils.h" #include "nsThreadUtils.h" #include "JavaScriptParent.h" diff --git a/js/xpconnect/src/XPCWrappedNative.cpp b/js/xpconnect/src/XPCWrappedNative.cpp index 75da46970b4..e77f13cf55d 100644 --- a/js/xpconnect/src/XPCWrappedNative.cpp +++ b/js/xpconnect/src/XPCWrappedNative.cpp @@ -15,7 +15,6 @@ #include "XrayWrapper.h" #include "nsContentUtils.h" -#include "nsCxPusher.h" #include #include "mozilla/Likely.h" diff --git a/js/xpconnect/src/XPCWrappedNativeInfo.cpp b/js/xpconnect/src/XPCWrappedNativeInfo.cpp index 304b85f0426..a5682fc78a1 100644 --- a/js/xpconnect/src/XPCWrappedNativeInfo.cpp +++ b/js/xpconnect/src/XPCWrappedNativeInfo.cpp @@ -8,7 +8,6 @@ #include "xpcprivate.h" #include "jswrapper.h" -#include "nsCxPusher.h" #include "mozilla/MemoryReporting.h" #include "mozilla/XPTInterfaceInfoManager.h" diff --git a/js/xpconnect/src/XPCWrappedNativeProto.cpp b/js/xpconnect/src/XPCWrappedNativeProto.cpp index 617cd8a320e..1fa9a370c48 100644 --- a/js/xpconnect/src/XPCWrappedNativeProto.cpp +++ b/js/xpconnect/src/XPCWrappedNativeProto.cpp @@ -7,7 +7,6 @@ /* Shared proto object for XPCWrappedNative. */ #include "xpcprivate.h" -#include "nsCxPusher.h" #include "pratom.h" using namespace mozilla; diff --git a/js/xpconnect/src/moz.build b/js/xpconnect/src/moz.build index 755f9caafcd..bdc7cd37802 100644 --- a/js/xpconnect/src/moz.build +++ b/js/xpconnect/src/moz.build @@ -6,7 +6,6 @@ EXPORTS += [ 'BackstagePass.h', - 'nsCxPusher.h', 'qsObjectHelper.h', 'XPCJSMemoryReporter.h', 'xpcObjectHelper.h', @@ -15,7 +14,6 @@ EXPORTS += [ UNIFIED_SOURCES += [ 'ExportHelpers.cpp', - 'nsCxPusher.cpp', 'nsScriptError.cpp', 'nsXPConnect.cpp', 'Sandbox.cpp', diff --git a/js/xpconnect/src/nsCxPusher.cpp b/js/xpconnect/src/nsCxPusher.cpp deleted file mode 100644 index 7f237c4dc5e..00000000000 --- a/js/xpconnect/src/nsCxPusher.cpp +++ /dev/null @@ -1,104 +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 "nsCxPusher.h" - -#include "nsIScriptContext.h" -#include "nsDOMJSUtils.h" -#include "xpcprivate.h" -#include "WorkerPrivate.h" - -using mozilla::DebugOnly; - -namespace mozilla { - -AutoJSContext::AutoJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL) - : mCx(nullptr) -{ - Init(false MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT); -} - -AutoJSContext::AutoJSContext(bool aSafe MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL) - : mCx(nullptr) -{ - Init(aSafe MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT); -} - -void -AutoJSContext::Init(bool aSafe MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL) -{ - JS::AutoSuppressGCAnalysis nogc; - MOZ_ASSERT(!mCx, "mCx should not be initialized!"); - - MOZ_GUARD_OBJECT_NOTIFIER_INIT; - - nsXPConnect *xpc = nsXPConnect::XPConnect(); - if (!aSafe) { - mCx = xpc->GetCurrentJSContext(); - } - - if (!mCx) { - mCx = xpc->GetSafeJSContext(); - mPusher.emplace(mCx); - } -} - -AutoJSContext::operator JSContext*() const -{ - return mCx; -} - -ThreadsafeAutoJSContext::ThreadsafeAutoJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL) -{ - MOZ_GUARD_OBJECT_NOTIFIER_INIT; - - if (NS_IsMainThread()) { - mCx = nullptr; - mAutoJSContext.emplace(); - } else { - mCx = mozilla::dom::workers::GetCurrentThreadJSContext(); - mRequest.emplace(mCx); - } -} - -ThreadsafeAutoJSContext::operator JSContext*() const -{ - if (mCx) { - return mCx; - } else { - return *mAutoJSContext; - } -} - -AutoSafeJSContext::AutoSafeJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL) - : AutoJSContext(true MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT) - , mAc(mCx, XPCJSRuntime::Get()->GetJSContextStack()->GetSafeJSContextGlobal()) -{ -} - -ThreadsafeAutoSafeJSContext::ThreadsafeAutoSafeJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL) -{ - MOZ_GUARD_OBJECT_NOTIFIER_INIT; - - if (NS_IsMainThread()) { - mCx = nullptr; - mAutoSafeJSContext.emplace(); - } else { - mCx = mozilla::dom::workers::GetCurrentThreadJSContext(); - mRequest.emplace(mCx); - } -} - -ThreadsafeAutoSafeJSContext::operator JSContext*() const -{ - if (mCx) { - return mCx; - } else { - return *mAutoSafeJSContext; - } -} - -} // namespace mozilla diff --git a/js/xpconnect/src/nsCxPusher.h b/js/xpconnect/src/nsCxPusher.h deleted file mode 100644 index 18f38a229a5..00000000000 --- a/js/xpconnect/src/nsCxPusher.h +++ /dev/null @@ -1,86 +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 nsCxPusher_h -#define nsCxPusher_h - -#include "jsapi.h" -#include "mozilla/Maybe.h" -#include "mozilla/dom/ScriptSettings.h" -#include "nsCOMPtr.h" - -class nsIScriptContext; - -namespace mozilla { - -/** - * Use AutoJSContext when you need a JS context on the stack but don't have one - * passed as a parameter. AutoJSContext will take care of finding the most - * appropriate JS context and release it when leaving the stack. - */ -class MOZ_STACK_CLASS AutoJSContext { -public: - explicit AutoJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM); - operator JSContext*() const; - -protected: - explicit AutoJSContext(bool aSafe MOZ_GUARD_OBJECT_NOTIFIER_PARAM); - - // We need this Init() method because we can't use delegating constructor for - // the moment. It is a C++11 feature and we do not require C++11 to be - // supported to be able to compile Gecko. - void Init(bool aSafe MOZ_GUARD_OBJECT_NOTIFIER_PARAM); - - JSContext* mCx; - Maybe mPusher; - MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER -}; - -/** - * Use ThreadsafeAutoJSContext when you want an AutoJSContext but might be - * running on a worker thread. - */ -class MOZ_STACK_CLASS ThreadsafeAutoJSContext { -public: - explicit ThreadsafeAutoJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM); - operator JSContext*() const; - -private: - JSContext* mCx; // Used on workers. Null means mainthread. - Maybe mRequest; // Used on workers. - Maybe mAutoJSContext; // Used on main thread. - MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER -}; - -/** - * AutoSafeJSContext is similar to AutoJSContext but will only return the safe - * JS context. That means it will never call ::GetCurrentJSContext(). - */ -class MOZ_STACK_CLASS AutoSafeJSContext : public AutoJSContext { -public: - explicit AutoSafeJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM); -private: - JSAutoCompartment mAc; -}; - -/** - * Like AutoSafeJSContext but can be used safely on worker threads. - */ -class MOZ_STACK_CLASS ThreadsafeAutoSafeJSContext { -public: - explicit ThreadsafeAutoSafeJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM); - operator JSContext*() const; - -private: - JSContext* mCx; // Used on workers. Null means mainthread. - Maybe mRequest; // Used on workers. - Maybe mAutoSafeJSContext; // Used on main thread. - MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER -}; - -} // namespace mozilla - -#endif /* nsCxPusher_h */ diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index 42f64478dce..a17623f6696 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -85,6 +85,8 @@ #include "mozilla/Preferences.h" #include "mozilla/TimeStamp.h" +#include "mozilla/dom/ScriptSettings.h" + #include #include #include @@ -157,7 +159,6 @@ #include "SandboxPrivate.h" #include "BackstagePass.h" -#include "nsCxPusher.h" #include "nsAXPCNativeCallContext.h" #ifdef XP_WIN @@ -2833,6 +2834,14 @@ void PopJSContextNoScriptContext(); } /* namespace xpc */ +namespace mozilla { +namespace dom { +namespace danger { +class AutoCxPusher; +} +} +} + class XPCJSContextStack { public: diff --git a/netwerk/base/src/Dashboard.cpp b/netwerk/base/src/Dashboard.cpp index fee88a5e6ce..7e758a2e53a 100644 --- a/netwerk/base/src/Dashboard.cpp +++ b/netwerk/base/src/Dashboard.cpp @@ -6,7 +6,6 @@ #include "mozilla/dom/ToJSValue.h" #include "mozilla/net/Dashboard.h" #include "mozilla/net/HttpInfo.h" -#include "nsCxPusher.h" #include "nsHttp.h" #include "nsICancelable.h" #include "nsIDNSService.h" diff --git a/netwerk/protocol/app/AppProtocolHandler.cpp b/netwerk/protocol/app/AppProtocolHandler.cpp index ac19890063c..4f13047c496 100644 --- a/netwerk/protocol/app/AppProtocolHandler.cpp +++ b/netwerk/protocol/app/AppProtocolHandler.cpp @@ -10,9 +10,10 @@ #include "nsNetCID.h" #include "nsIAppsService.h" #include "nsILoadInfo.h" -#include "nsCxPusher.h" #include "nsXULAppAPI.h" +#include "mozilla/dom/ScriptSettings.h" + /** * This dummy channel implementation only provides enough functionality * to return a fake 404 error when the caller asks for an app:// URL diff --git a/toolkit/mozapps/extensions/AddonPathService.cpp b/toolkit/mozapps/extensions/AddonPathService.cpp index 5e312dd942b..3681de016be 100644 --- a/toolkit/mozapps/extensions/AddonPathService.cpp +++ b/toolkit/mozapps/extensions/AddonPathService.cpp @@ -9,7 +9,6 @@ #include "nsIURI.h" #include "nsXULAppAPI.h" #include "jsapi.h" -#include "nsCxPusher.h" #include "nsServiceManagerUtils.h" #include "nsLiteralString.h" #include "nsThreadUtils.h" @@ -19,6 +18,7 @@ #include "nsIChromeRegistry.h" #include "nsIJARURI.h" #include "nsJSUtils.h" +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/AddonPathService.h" #include "mozilla/Omnijar.h" diff --git a/xpcom/reflect/xptinfo/xptiInterfaceInfo.cpp b/xpcom/reflect/xptinfo/xptiInterfaceInfo.cpp index c091eddf6e5..2515a0b553a 100644 --- a/xpcom/reflect/xptinfo/xptiInterfaceInfo.cpp +++ b/xpcom/reflect/xptinfo/xptiInterfaceInfo.cpp @@ -6,10 +6,10 @@ /* Implementation of xptiInterfaceEntry and xptiInterfaceInfo. */ #include "xptiprivate.h" +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/DebugOnly.h" #include "mozilla/XPTInterfaceInfoManager.h" #include "mozilla/PodOperations.h" -#include "nsCxPusher.h" #include "jsapi.h" using namespace mozilla;