diff --git a/dom/audiochannel/AudioChannelService.cpp b/dom/audiochannel/AudioChannelService.cpp index dcfa0a469a5..5a3ddabb4c5 100644 --- a/dom/audiochannel/AudioChannelService.cpp +++ b/dom/audiochannel/AudioChannelService.cpp @@ -18,6 +18,8 @@ #include "nsThreadUtils.h" #include "nsHashPropertyBag.h" +#include "nsComponentManagerUtils.h" +#include "nsServiceManagerUtils.h" #ifdef MOZ_WIDGET_GONK #include "nsJSUtils.h" diff --git a/dom/base/Crypto.cpp b/dom/base/Crypto.cpp index f5eaf8784de..f50979ae8d8 100644 --- a/dom/base/Crypto.cpp +++ b/dom/base/Crypto.cpp @@ -11,6 +11,7 @@ #include "mozilla/dom/ContentChild.h" #include "mozilla/dom/CryptoBinding.h" +#include "nsServiceManagerUtils.h" using mozilla::dom::ContentChild; diff --git a/dom/base/nsContentPermissionHelper.cpp b/dom/base/nsContentPermissionHelper.cpp index 811b5b37e87..42ed0ead3fb 100644 --- a/dom/base/nsContentPermissionHelper.cpp +++ b/dom/base/nsContentPermissionHelper.cpp @@ -9,6 +9,7 @@ #include "nsIPrincipal.h" #include "mozilla/dom/Element.h" #include "mozilla/unused.h" +#include "nsComponentManagerUtils.h" using mozilla::unused; // using namespace mozilla::dom; diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 327959cf7f6..4f283654b82 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -82,6 +82,7 @@ #include "nsIBaseWindow.h" #include "nsIDocShellTreeOwner.h" #include "nsIInterfaceRequestorUtils.h" +#include "GeckoProfiler.h" #ifdef XP_WIN #undef GetClassName diff --git a/dom/bluetooth/BluetoothA2dpManager.cpp b/dom/bluetooth/BluetoothA2dpManager.cpp index fb4b8a57fc4..991a4f63caf 100644 --- a/dom/bluetooth/BluetoothA2dpManager.cpp +++ b/dom/bluetooth/BluetoothA2dpManager.cpp @@ -337,8 +337,7 @@ BluetoothA2dpManager::NotifyConnectionStatusChanged() MOZ_ASSERT(NS_IsMainThread()); // Notify Gecko observers - nsCOMPtr obs = - do_GetService("@mozilla.org/observer-service;1"); + nsCOMPtr obs = services::GetObserverService(); NS_ENSURE_TRUE_VOID(obs); if (NS_FAILED(obs->NotifyObservers(this, diff --git a/dom/bluetooth/BluetoothHfpManager.cpp b/dom/bluetooth/BluetoothHfpManager.cpp index da91ce2ec9c..481dfe760bb 100644 --- a/dom/bluetooth/BluetoothHfpManager.cpp +++ b/dom/bluetooth/BluetoothHfpManager.cpp @@ -27,6 +27,7 @@ #include "nsISettingsService.h" #include "nsITelephonyProvider.h" #include "nsRadioInterfaceLayer.h" +#include "nsServiceManagerUtils.h" /** * BRSF bitmask of AG supported features. See 4.34.1 "Bluetooth Defined AT @@ -448,8 +449,7 @@ BluetoothHfpManager::NotifyConnectionStatusChanged(const nsAString& aType) MOZ_ASSERT(NS_IsMainThread()); // Notify Gecko observers - nsCOMPtr obs = - do_GetService("@mozilla.org/observer-service;1"); + nsCOMPtr obs = services::GetObserverService(); NS_ENSURE_TRUE_VOID(obs); if (NS_FAILED(obs->NotifyObservers(this, NS_ConvertUTF16toUTF8(aType).get(), diff --git a/dom/bluetooth/BluetoothOppManager.cpp b/dom/bluetooth/BluetoothOppManager.cpp index 68432b1cbb6..6d6e392f098 100644 --- a/dom/bluetooth/BluetoothOppManager.cpp +++ b/dom/bluetooth/BluetoothOppManager.cpp @@ -30,6 +30,7 @@ #include "nsIOutputStream.h" #include "nsIVolumeService.h" #include "nsNetUtil.h" +#include "nsServiceManagerUtils.h" #define TARGET_SUBDIR "Download/Bluetooth/" diff --git a/dom/bluetooth/BluetoothPropertyContainer.cpp b/dom/bluetooth/BluetoothPropertyContainer.cpp index 21708886e34..0b76332d3a0 100644 --- a/dom/bluetooth/BluetoothPropertyContainer.cpp +++ b/dom/bluetooth/BluetoothPropertyContainer.cpp @@ -10,6 +10,7 @@ #include "DOMRequest.h" #include "mozilla/ErrorResult.h" #include "mozilla/dom/bluetooth/BluetoothTypes.h" +#include "nsServiceManagerUtils.h" USING_BLUETOOTH_NAMESPACE diff --git a/dom/bluetooth/BluetoothReplyRunnable.cpp b/dom/bluetooth/BluetoothReplyRunnable.cpp index 2ac0d6de2d7..d7aae86635d 100644 --- a/dom/bluetooth/BluetoothReplyRunnable.cpp +++ b/dom/bluetooth/BluetoothReplyRunnable.cpp @@ -8,6 +8,7 @@ #include "BluetoothReplyRunnable.h" #include "DOMRequest.h" #include "mozilla/dom/bluetooth/BluetoothTypes.h" +#include "nsServiceManagerUtils.h" USING_BLUETOOTH_NAMESPACE diff --git a/dom/bluetooth/BluetoothService.cpp b/dom/bluetooth/BluetoothService.cpp index 2bde2dae86e..15351556fdb 100644 --- a/dom/bluetooth/BluetoothService.cpp +++ b/dom/bluetooth/BluetoothService.cpp @@ -34,6 +34,7 @@ #include "nsISettingsService.h" #include "nsISystemMessagesInternal.h" #include "nsITimer.h" +#include "nsServiceManagerUtils.h" #include "nsThreadUtils.h" #include "nsXPCOM.h" diff --git a/dom/bluetooth/BluetoothUtils.cpp b/dom/bluetooth/BluetoothUtils.cpp index d9bb8600145..32422b5b1ab 100644 --- a/dom/bluetooth/BluetoothUtils.cpp +++ b/dom/bluetooth/BluetoothUtils.cpp @@ -18,6 +18,7 @@ #include "nsISystemMessagesInternal.h" #include "nsString.h" #include "nsTArray.h" +#include "nsServiceManagerUtils.h" BEGIN_BLUETOOTH_NAMESPACE diff --git a/dom/ipc/ProcessPriorityManager.cpp b/dom/ipc/ProcessPriorityManager.cpp index 0bd4a24cd53..915626a70dc 100644 --- a/dom/ipc/ProcessPriorityManager.cpp +++ b/dom/ipc/ProcessPriorityManager.cpp @@ -24,6 +24,7 @@ #include "nsIObserver.h" #include "nsITimer.h" #include "nsIPropertyBag2.h" +#include "nsComponentManagerUtils.h" #ifdef XP_WIN #include diff --git a/dom/ipc/TabContext.cpp b/dom/ipc/TabContext.cpp index a774ee09738..4818deac353 100644 --- a/dom/ipc/TabContext.cpp +++ b/dom/ipc/TabContext.cpp @@ -10,6 +10,7 @@ #include "mozilla/dom/TabChild.h" #include "nsIAppsService.h" #include "nsIScriptSecurityManager.h" +#include "nsServiceManagerUtils.h" #define NO_APP_ID (nsIScriptSecurityManager::NO_APP_ID) diff --git a/dom/media/MediaPermissionGonk.cpp b/dom/media/MediaPermissionGonk.cpp index fe1862ee391..3f14f2efc3a 100644 --- a/dom/media/MediaPermissionGonk.cpp +++ b/dom/media/MediaPermissionGonk.cpp @@ -19,6 +19,7 @@ #include "mozilla/dom/TabChild.h" #include "mozilla/dom/MediaStreamTrackBinding.h" #include "nsISupportsPrimitives.h" +#include "nsServiceManagerUtils.h" #define AUDIO_PERMISSION_NAME "audio-capture" diff --git a/dom/mobilemessage/src/gonk/SmsService.cpp b/dom/mobilemessage/src/gonk/SmsService.cpp index 335334786fb..a6138235688 100644 --- a/dom/mobilemessage/src/gonk/SmsService.cpp +++ b/dom/mobilemessage/src/gonk/SmsService.cpp @@ -7,6 +7,7 @@ #include "SmsService.h" #include "jsapi.h" #include "SmsSegmentInfo.h" +#include "nsServiceManagerUtils.h" namespace mozilla { namespace dom { diff --git a/dom/mobilemessage/src/ipc/SmsParent.cpp b/dom/mobilemessage/src/ipc/SmsParent.cpp index af38921561b..d4e7a299b2d 100755 --- a/dom/mobilemessage/src/ipc/SmsParent.cpp +++ b/dom/mobilemessage/src/ipc/SmsParent.cpp @@ -24,6 +24,7 @@ #include "nsContentUtils.h" #include "nsTArrayHelpers.h" #include "nsCxPusher.h" +#include "nsServiceManagerUtils.h" namespace mozilla { namespace dom { diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp index 09279f381e4..e064676421e 100755 --- a/dom/plugins/ipc/PluginModuleParent.cpp +++ b/dom/plugins/ipc/PluginModuleParent.cpp @@ -30,6 +30,7 @@ #include "nsPrintfCString.h" #include "PluginIdentifierParent.h" #include "prsystem.h" +#include "GeckoProfiler.h" #ifdef XP_WIN #include "PluginHangUIParent.h" diff --git a/dom/src/notification/DesktopNotification.cpp b/dom/src/notification/DesktopNotification.cpp index 675771bd349..09d3910d9b1 100644 --- a/dom/src/notification/DesktopNotification.cpp +++ b/dom/src/notification/DesktopNotification.cpp @@ -13,6 +13,7 @@ #include "nsIAppsService.h" #include "PCOMContentPermissionRequestChild.h" #include "nsIScriptSecurityManager.h" +#include "nsServiceManagerUtils.h" namespace mozilla { namespace dom { diff --git a/dom/system/gonk/AudioManager.cpp b/dom/system/gonk/AudioManager.cpp index dfce21fad15..1bcf533ea92 100644 --- a/dom/system/gonk/AudioManager.cpp +++ b/dom/system/gonk/AudioManager.cpp @@ -33,6 +33,8 @@ #include "nsJSUtils.h" #include "nsCxPusher.h" #include "nsThreadUtils.h" +#include "nsServiceManagerUtils.h" +#include "nsComponentManagerUtils.h" using namespace mozilla::dom::gonk; using namespace android; diff --git a/dom/system/gonk/nsVolumeMountLock.cpp b/dom/system/gonk/nsVolumeMountLock.cpp index 09699e8ed79..849094ec186 100644 --- a/dom/system/gonk/nsVolumeMountLock.cpp +++ b/dom/system/gonk/nsVolumeMountLock.cpp @@ -16,6 +16,7 @@ #define VOLUME_MANAGER_LOG_TAG "nsVolumeMountLock" #include "VolumeManagerLog.h" +#include "nsServiceManagerUtils.h" using namespace mozilla::dom; using namespace mozilla::services; diff --git a/dom/telephony/ipc/TelephonyParent.cpp b/dom/telephony/ipc/TelephonyParent.cpp index c55a90b8553..8db736c390d 100644 --- a/dom/telephony/ipc/TelephonyParent.cpp +++ b/dom/telephony/ipc/TelephonyParent.cpp @@ -4,6 +4,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/dom/telephony/TelephonyParent.h" +#include "nsServiceManagerUtils.h" USING_TELEPHONY_NAMESPACE diff --git a/hal/android/AndroidHal.cpp b/hal/android/AndroidHal.cpp index 039b9913fb9..42ab2a82e9c 100644 --- a/hal/android/AndroidHal.cpp +++ b/hal/android/AndroidHal.cpp @@ -10,6 +10,7 @@ #include "mozilla/dom/network/Constants.h" #include "mozilla/dom/ScreenOrientation.h" #include "nsIScreenManager.h" +#include "nsServiceManagerUtils.h" using namespace mozilla::dom; using namespace mozilla::hal; diff --git a/hal/cocoa/CocoaSensor.mm b/hal/cocoa/CocoaSensor.mm index b6098466115..2c8130fb003 100644 --- a/hal/cocoa/CocoaSensor.mm +++ b/hal/cocoa/CocoaSensor.mm @@ -4,6 +4,7 @@ #include "Hal.h" #include "nsITimer.h" #include "smslib.h" +#include "nsComponentManagerUtils.h" #include #include diff --git a/hal/fallback/FallbackAlarm.cpp b/hal/fallback/FallbackAlarm.cpp index 006fdc29b9c..f7e08d0c37e 100644 --- a/hal/fallback/FallbackAlarm.cpp +++ b/hal/fallback/FallbackAlarm.cpp @@ -6,10 +6,10 @@ #include -#include - #include "mozilla/ClearOnShutdown.h" #include "mozilla/StaticPtr.h" +#include "nsComponentManagerUtils.h" +#include "nsITimer.h" #include "nsThreadUtils.h" namespace mozilla { diff --git a/hal/fallback/FallbackScreenConfiguration.cpp b/hal/fallback/FallbackScreenConfiguration.cpp index de9b66be09d..0c01821976c 100644 --- a/hal/fallback/FallbackScreenConfiguration.cpp +++ b/hal/fallback/FallbackScreenConfiguration.cpp @@ -5,6 +5,7 @@ #include "Hal.h" #include "mozilla/dom/ScreenOrientation.h" #include "nsIScreenManager.h" +#include "nsServiceManagerUtils.h" namespace mozilla { namespace hal_impl { diff --git a/hal/windows/WindowsBattery.cpp b/hal/windows/WindowsBattery.cpp index 7d7d9d36eaa..70b5852ba10 100644 --- a/hal/windows/WindowsBattery.cpp +++ b/hal/windows/WindowsBattery.cpp @@ -8,6 +8,7 @@ #include "nsITimer.h" #include "mozilla/Preferences.h" #include "mozilla/dom/battery/Constants.h" +#include "nsComponentManagerUtils.h" #include #include "nsWindowsHelpers.h" diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp index c7bc0c06a45..a806b16b07b 100644 --- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -36,6 +36,7 @@ #include "nsObjectFrame.h" #include "nsContentUtils.h" #include "nsIPermissionManager.h" +#include "nsServiceManagerUtils.h" using namespace mozilla; using mozilla::layout::RenderFrameParent; diff --git a/toolkit/xre/ProfileReset.h b/toolkit/xre/ProfileReset.h index 21389b5b64c..faf74d09820 100644 --- a/toolkit/xre/ProfileReset.h +++ b/toolkit/xre/ProfileReset.h @@ -4,7 +4,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsIToolkitProfileService.h" - +#include "nsIFile.h" #include "nsThreadUtils.h" static bool gProfileResetCleanupCompleted = false; diff --git a/widget/gonk/OrientationObserver.cpp b/widget/gonk/OrientationObserver.cpp index 8a611f285cf..bc0a8f26611 100644 --- a/widget/gonk/OrientationObserver.cpp +++ b/widget/gonk/OrientationObserver.cpp @@ -24,6 +24,7 @@ #include "OrientationObserver.h" #include "mozilla/HalSensor.h" #include "ProcessOrientation.h" +#include "nsServiceManagerUtils.h" using namespace mozilla; using namespace dom; diff --git a/widget/gonk/OrientationObserver.h b/widget/gonk/OrientationObserver.h index 68d6143c342..d0b6046793f 100644 --- a/widget/gonk/OrientationObserver.h +++ b/widget/gonk/OrientationObserver.h @@ -20,6 +20,7 @@ #include "mozilla/Observer.h" #include "mozilla/dom/ScreenOrientation.h" +#include "mozilla/Scoped.h" namespace mozilla { class ProcessOrientation; diff --git a/xpcom/base/nsMemoryInfoDumper.cpp b/xpcom/base/nsMemoryInfoDumper.cpp index dcd7b8d6fae..201f57ee761 100644 --- a/xpcom/base/nsMemoryInfoDumper.cpp +++ b/xpcom/base/nsMemoryInfoDumper.cpp @@ -20,6 +20,8 @@ #include "nsJSEnvironment.h" #include "nsPrintfCString.h" #include "nsISimpleEnumerator.h" +#include "nsServiceManagerUtils.h" +#include "nsIFile.h" #include #ifdef XP_WIN