From e1daca3ce3008bcce0204eed1aa1a0cd3ce63f84 Mon Sep 17 00:00:00 2001 From: "bryner%brianryner.com" Date: Wed, 24 Nov 2004 22:48:45 +0000 Subject: [PATCH] Reduce do_GetService code bloat further by adding specialized assignment to nsCOMPtr and providing a version with no error pointer. Also make CallGetService work the same way as CallGetComponent does, as far as using frozen/non-frozen interface to service manager. Bug 264456, r=darin. git-svn-id: svn://10.0.0.236/trunk@165757 18797224-902f-48f8-a5cc-f745e15eee43 --- .../accessible/src/base/nsCaretAccessible.cpp | 2 +- .../src/nsBrowserProfileMigratorUtils.cpp | 2 +- .../migration/src/nsIEProfileMigrator.cpp | 2 +- .../PreferencePanes/Privacy/PrivacyPane.mm | 2 +- .../PreferencePanes/Security/SecurityPane.mm | 2 +- .../WebFeatures/WebFeatures.mm | 2 +- .../src/browser/BrowserWindowController.mm | 2 +- .../camino/src/browser/CocoaPromptService.mm | 2 +- mozilla/camino/src/browser/SecurityDialogs.mm | 2 +- .../extensions/RDFOutlineViewDataSource.mm | 2 +- mozilla/camino/src/history/RDFItem.mm | 2 +- .../base/src/nsContentAreaDragDrop.cpp | 2 +- mozilla/content/base/src/nsContentSink.cpp | 2 +- mozilla/content/base/src/nsContentUtils.cpp | 2 +- .../base/src/nsImageLoadingContent.cpp | 2 +- .../base/src/nsLayoutStylesheetCache.cpp | 2 +- .../html/content/src/nsHTMLScriptElement.cpp | 2 +- .../xul/content/src/nsXULPopupListener.cpp | 2 +- .../docshell/base/nsGlobalHistory2Adapter.cpp | 2 +- .../docshell/base/nsGlobalHistoryAdapter.cpp | 2 +- mozilla/dom/src/base/nsFocusController.cpp | 2 +- .../composer/src/nsComposerRegistration.cpp | 2 +- .../composer/src/nsEditorParserObserver.cpp | 2 +- .../composer/src/nsEditorSpellCheck.cpp | 2 +- mozilla/editor/libeditor/base/nsEditor.cpp | 2 +- .../text/nsPlaintextDataTransfer.cpp | 2 +- .../activex/src/plugin/PrefObserver.cpp | 2 +- .../browser/activex/src/plugin/XPCBrowser.cpp | 2 +- .../browser/activex/src/plugin/XPConnect.cpp | 2 +- .../browser/activex/src/plugin/XPConnect.h | 2 +- .../browser/gtk/src/EmbedContentListener.cpp | 2 +- .../photon/src/EmbedContentListener.cpp | 2 +- .../powerplant/source/CBrowserChrome.cpp | 2 +- .../powerplant/source/CPrintAttachment.cpp | 2 +- .../powerplant/source/CWindowCreator.cpp | 2 +- .../browser/qt/src/EmbedContentListener.cpp | 2 +- .../commandhandler/src/nsCommandManager.cpp | 2 +- .../embedding/components/find/src/nsFind.cpp | 2 +- .../minimo/popuplite/nsSimplePopupBlocker.cpp | 2 +- .../embedding/qa/mozembed/src/mozEmbed.cpp | 2 +- .../qa/mozembed/src/nsQAWindowCreator.cpp | 2 +- .../embedding/tests/mfcembed/BrowserView.cpp | 2 +- mozilla/embedding/tests/mfcembed/MfcEmbed.cpp | 2 +- .../tests/mfcembed/MostRecentUrls.cpp | 2 +- .../embedding/tests/mfcembed/ProfileMgr.cpp | 2 +- .../embedding/tests/mfcembed/ProfilesDlg.cpp | 2 +- .../mfcembed/winEmbedFileLocProvider.cpp | 2 +- .../cookie/nsPopupWindowManager.cpp | 2 +- .../inspector/base/src/inDeepTreeWalker.cpp | 2 +- .../source/xslt/txInstructions.cpp | 2 +- .../src/nsTridentPreferencesWin.cpp | 2 +- .../extensions/webdav/src/nsWebDAVService.cpp | 2 +- mozilla/gfx/src/cairo/nsFontMetricsUtils.cpp | 2 +- mozilla/gfx/src/cairo/nsFontMetricsXft.cpp | 2 +- mozilla/gfx/src/gtk/nsFontMetricsPango.cpp | 2 +- mozilla/gfx/src/gtk/nsFontMetricsUtils.cpp | 2 +- mozilla/gfx/src/gtk/nsFontMetricsXft.cpp | 2 +- mozilla/gfx/src/mac/nsPrintSettingsX.cpp | 2 +- mozilla/intl/locale/src/nsLocaleService.cpp | 2 +- mozilla/intl/lwbrk/tests/TestLineBreak.cpp | 2 +- mozilla/intl/uconv/src/nsWinCharset.cpp | 2 +- .../intl/uconv/ucvko/nsUnicodeToJamoTTF.cpp | 2 +- .../dconnect/src/ipcDConnectService.cpp | 2 +- .../extensions/lock/test/TestIPCLocks.cpp | 2 +- .../java/webclient/src_moz/NavigationImpl.cpp | 2 +- .../layout/style/nsLayoutStylesheetCache.cpp | 2 +- .../src/nsMailProfileMigratorUtils.cpp | 2 +- .../modules/libpr0n/build/nsImageModule.cpp | 2 +- .../libpref/src/nsSharedPrefHandler.cpp | 2 +- mozilla/netwerk/base/public/nsNetUtil.h | 4 +- .../exthandler/nsExternalProtocolHandler.cpp | 2 +- mozilla/view/src/nsScrollPortView.cpp | 2 +- mozilla/widget/src/gtk2/nsAppShell.cpp | 2 +- mozilla/widget/src/qt/nsAppShell.cpp | 2 +- mozilla/widget/src/xpwidgets/nsBaseWidget.cpp | 2 +- mozilla/xpcom/build/nsOS2VACLegacy.cpp | 2 +- mozilla/xpcom/components/Makefile.in | 1 - .../xpcom/components/nsCategoryManager.cpp | 2 +- .../xpcom/components/nsComponentManager.cpp | 31 ++- .../xpcom/components/nsIServiceManager.idl | 2 +- .../xpcom/components/nsIServiceManagerUtils.h | 183 ------------- mozilla/xpcom/glue/nsCOMPtr.cpp | 36 +++ mozilla/xpcom/glue/nsCOMPtr.h | 241 ++++++++++++++++++ .../xpcom/glue/nsComponentManagerUtils.cpp | 105 ++++++-- mozilla/xpcom/glue/nsServiceManagerUtils.h | 107 +++----- mozilla/xpcom/glue/objs.mk | 1 + mozilla/xpcom/io/nsIFastLoadService.idl | 4 +- mozilla/xpcom/stub/nsOS2VACLegacy.cpp | 2 +- mozilla/xpcom/tools/registry/Makefile.in | 1 + mozilla/xpfe/bootstrap/nsAppRunner.cpp | 2 +- .../xpfe/bootstrap/nsNativeAppSupportOS2.cpp | 2 +- .../xpfe/bootstrap/nsNativeAppSupportWin.cpp | 2 +- 92 files changed, 490 insertions(+), 386 deletions(-) delete mode 100644 mozilla/xpcom/components/nsIServiceManagerUtils.h diff --git a/mozilla/accessible/src/base/nsCaretAccessible.cpp b/mozilla/accessible/src/base/nsCaretAccessible.cpp index ce28434313e..9c7a467624b 100644 --- a/mozilla/accessible/src/base/nsCaretAccessible.cpp +++ b/mozilla/accessible/src/base/nsCaretAccessible.cpp @@ -48,7 +48,7 @@ #include "nsIPresShell.h" #include "nsISelectionController.h" #include "nsISelectionPrivate.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIViewManager.h" #include "nsIWidget.h" #include "nsRootAccessible.h" diff --git a/mozilla/browser/components/migration/src/nsBrowserProfileMigratorUtils.cpp b/mozilla/browser/components/migration/src/nsBrowserProfileMigratorUtils.cpp index 42232e291c6..fa0b27f9200 100644 --- a/mozilla/browser/components/migration/src/nsBrowserProfileMigratorUtils.cpp +++ b/mozilla/browser/components/migration/src/nsBrowserProfileMigratorUtils.cpp @@ -40,7 +40,7 @@ #include "nsIProperties.h" #include "nsIProfileMigrator.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsAppDirectoryServiceDefs.h" #include "nsXPCOMCID.h" #include "nsCRT.h" diff --git a/mozilla/browser/components/migration/src/nsIEProfileMigrator.cpp b/mozilla/browser/components/migration/src/nsIEProfileMigrator.cpp index 4753cb8215c..ed6495e2f57 100644 --- a/mozilla/browser/components/migration/src/nsIEProfileMigrator.cpp +++ b/mozilla/browser/components/migration/src/nsIEProfileMigrator.cpp @@ -60,7 +60,7 @@ #include "nsILocalFile.h" #include "nsIPrefService.h" #include "nsIPrefBranch.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsISimpleEnumerator.h" #include "nsISupportsArray.h" #include "nsIProfileMigrator.h" diff --git a/mozilla/camino/PreferencePanes/Privacy/PrivacyPane.mm b/mozilla/camino/PreferencePanes/Privacy/PrivacyPane.mm index d6a7d41d999..d194b8115c4 100644 --- a/mozilla/camino/PreferencePanes/Privacy/PrivacyPane.mm +++ b/mozilla/camino/PreferencePanes/Privacy/PrivacyPane.mm @@ -2,7 +2,7 @@ #import "NSString+Utils.h" #include "nsCOMPtr.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIPref.h" #include "nsNetCID.h" #include "nsICookie.h" diff --git a/mozilla/camino/PreferencePanes/Security/SecurityPane.mm b/mozilla/camino/PreferencePanes/Security/SecurityPane.mm index 43dd9c9be3d..2d9ce4921c5 100644 --- a/mozilla/camino/PreferencePanes/Security/SecurityPane.mm +++ b/mozilla/camino/PreferencePanes/Security/SecurityPane.mm @@ -1,6 +1,6 @@ #import "SecurityPane.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIPref.h" // prefs for showing security dialogs diff --git a/mozilla/camino/PreferencePanes/WebFeatures/WebFeatures.mm b/mozilla/camino/PreferencePanes/WebFeatures/WebFeatures.mm index c0380fe7f60..d3f23b702d5 100644 --- a/mozilla/camino/PreferencePanes/WebFeatures/WebFeatures.mm +++ b/mozilla/camino/PreferencePanes/WebFeatures/WebFeatures.mm @@ -2,7 +2,7 @@ #import "NSString+Utils.h" #include "nsCOMPtr.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIPermissionManager.h" #include "nsIPermission.h" #include "nsISupportsArray.h" diff --git a/mozilla/camino/src/browser/BrowserWindowController.mm b/mozilla/camino/src/browser/BrowserWindowController.mm index dccf5004c9a..107b568aa7c 100644 --- a/mozilla/camino/src/browser/BrowserWindowController.mm +++ b/mozilla/camino/src/browser/BrowserWindowController.mm @@ -82,7 +82,7 @@ #include "nsIWebBrowser.h" #include "nsIInterfaceRequestorUtils.h" #include "nsIPrefBranch.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIRDFRemoteDataSource.h" #include "nsIURI.h" #include "nsIURIFixup.h" diff --git a/mozilla/camino/src/browser/CocoaPromptService.mm b/mozilla/camino/src/browser/CocoaPromptService.mm index eaa70e947c5..939bd2b6c99 100644 --- a/mozilla/camino/src/browser/CocoaPromptService.mm +++ b/mozilla/camino/src/browser/CocoaPromptService.mm @@ -46,7 +46,7 @@ #include "nsIWebBrowserChrome.h" #include "nsIEmbeddingSiteWindow.h" #include "nsString.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" CocoaPromptService::CocoaPromptService() { diff --git a/mozilla/camino/src/browser/SecurityDialogs.mm b/mozilla/camino/src/browser/SecurityDialogs.mm index 061c27b449f..29cb4ee80fe 100644 --- a/mozilla/camino/src/browser/SecurityDialogs.mm +++ b/mozilla/camino/src/browser/SecurityDialogs.mm @@ -46,7 +46,7 @@ #include "nsIPrompt.h" #include "nsIInterfaceRequestor.h" #include "nsIInterfaceRequestorUtils.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" SecurityDialogs::SecurityDialogs() { diff --git a/mozilla/camino/src/extensions/RDFOutlineViewDataSource.mm b/mozilla/camino/src/extensions/RDFOutlineViewDataSource.mm index e4fcfb96e22..9f7b857ccbe 100644 --- a/mozilla/camino/src/extensions/RDFOutlineViewDataSource.mm +++ b/mozilla/camino/src/extensions/RDFOutlineViewDataSource.mm @@ -54,7 +54,7 @@ #include "nsRDFCID.h" #include "nsComponentManagerUtils.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsXPIDLString.h" #include "nsString.h" diff --git a/mozilla/camino/src/history/RDFItem.mm b/mozilla/camino/src/history/RDFItem.mm index 95b0f6e3757..3ec63e6f3d4 100644 --- a/mozilla/camino/src/history/RDFItem.mm +++ b/mozilla/camino/src/history/RDFItem.mm @@ -54,7 +54,7 @@ #include "nsRDFCID.h" #include "nsComponentManagerUtils.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsString.h" diff --git a/mozilla/content/base/src/nsContentAreaDragDrop.cpp b/mozilla/content/base/src/nsContentAreaDragDrop.cpp index af7fcea78d2..9681b89863e 100644 --- a/mozilla/content/base/src/nsContentAreaDragDrop.cpp +++ b/mozilla/content/base/src/nsContentAreaDragDrop.cpp @@ -70,7 +70,7 @@ #include "nsComponentManagerUtils.h" #include "nsXPCOM.h" #include "nsISupportsPrimitives.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsNetUtil.h" #include "nsIFile.h" #include "nsIWebNavigation.h" diff --git a/mozilla/content/base/src/nsContentSink.cpp b/mozilla/content/base/src/nsContentSink.cpp index 394968373ee..6c90a020b3f 100644 --- a/mozilla/content/base/src/nsContentSink.cpp +++ b/mozilla/content/base/src/nsContentSink.cpp @@ -68,7 +68,7 @@ #include "nsNetCID.h" #include "nsICookieService.h" #include "nsIPrompt.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsICharsetConverterManager.h" #include "nsContentUtils.h" #include "nsParserUtils.h" diff --git a/mozilla/content/base/src/nsContentUtils.cpp b/mozilla/content/base/src/nsContentUtils.cpp index 90f68ef689d..938508fc92e 100644 --- a/mozilla/content/base/src/nsContentUtils.cpp +++ b/mozilla/content/base/src/nsContentUtils.cpp @@ -49,7 +49,7 @@ #include "nsIPrefService.h" #include "nsIPrefBranch.h" #include "nsIPrefLocalizedString.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIScriptGlobalObject.h" #include "nsIScriptContext.h" #include "nsIDOMScriptObjectFactory.h" diff --git a/mozilla/content/base/src/nsImageLoadingContent.cpp b/mozilla/content/base/src/nsImageLoadingContent.cpp index 4f3d4596d07..b7b972efb43 100644 --- a/mozilla/content/base/src/nsImageLoadingContent.cpp +++ b/mozilla/content/base/src/nsImageLoadingContent.cpp @@ -44,7 +44,7 @@ #include "nsINodeInfo.h" #include "nsIScriptGlobalObject.h" #include "nsIDOMWindow.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsContentPolicyUtils.h" #include "nsIURI.h" #include "nsILoadGroup.h" diff --git a/mozilla/content/base/src/nsLayoutStylesheetCache.cpp b/mozilla/content/base/src/nsLayoutStylesheetCache.cpp index 9d3525aeeb5..c05a02211ec 100644 --- a/mozilla/content/base/src/nsLayoutStylesheetCache.cpp +++ b/mozilla/content/base/src/nsLayoutStylesheetCache.cpp @@ -43,7 +43,7 @@ #include "nsLayoutCID.h" #include "nsNetUtil.h" #include "nsIObserverService.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" NS_IMPL_ISUPPORTS1(nsLayoutStylesheetCache, nsIObserver) diff --git a/mozilla/content/html/content/src/nsHTMLScriptElement.cpp b/mozilla/content/html/content/src/nsHTMLScriptElement.cpp index 7971474e3d8..1452f4566e9 100644 --- a/mozilla/content/html/content/src/nsHTMLScriptElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLScriptElement.cpp @@ -55,7 +55,7 @@ #include "nsIScriptContext.h" #include "nsIScriptGlobalObject.h" #include "nsIXPConnect.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIScriptEventHandler.h" #include "nsIDOMDocument.h" diff --git a/mozilla/content/xul/content/src/nsXULPopupListener.cpp b/mozilla/content/xul/content/src/nsXULPopupListener.cpp index 0504b41d860..7aaa7e6d076 100644 --- a/mozilla/content/xul/content/src/nsXULPopupListener.cpp +++ b/mozilla/content/xul/content/src/nsXULPopupListener.cpp @@ -67,7 +67,7 @@ #include "nsIDOMNSUIEvent.h" #include "nsIDOMEventTarget.h" #include "nsIDOMNSEvent.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIPrincipal.h" #include "nsIScriptSecurityManager.h" diff --git a/mozilla/docshell/base/nsGlobalHistory2Adapter.cpp b/mozilla/docshell/base/nsGlobalHistory2Adapter.cpp index 3beba6256d8..a3feb847eb0 100644 --- a/mozilla/docshell/base/nsGlobalHistory2Adapter.cpp +++ b/mozilla/docshell/base/nsGlobalHistory2Adapter.cpp @@ -38,7 +38,7 @@ #include "nsGlobalHistory2Adapter.h" #include "nsDocShellCID.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIComponentRegistrar.h" #include "nsGlobalHistoryAdapter.h" #include "nsIURI.h" diff --git a/mozilla/docshell/base/nsGlobalHistoryAdapter.cpp b/mozilla/docshell/base/nsGlobalHistoryAdapter.cpp index dc70c5e36da..de25ed57a8e 100644 --- a/mozilla/docshell/base/nsGlobalHistoryAdapter.cpp +++ b/mozilla/docshell/base/nsGlobalHistoryAdapter.cpp @@ -38,7 +38,7 @@ #include "nsGlobalHistoryAdapter.h" #include "nsDocShellCID.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIComponentRegistrar.h" #include "nsGlobalHistory2Adapter.h" #include "nsIURI.h" diff --git a/mozilla/dom/src/base/nsFocusController.cpp b/mozilla/dom/src/base/nsFocusController.cpp index 32236031274..f4c44e17922 100644 --- a/mozilla/dom/src/base/nsFocusController.cpp +++ b/mozilla/dom/src/base/nsFocusController.cpp @@ -62,7 +62,7 @@ #include "nsIDocShellTreeItem.h" #include "nsIDocShellTreeOwner.h" #include "nsIInterfaceRequestorUtils.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsGlobalWindow.h" #ifdef MOZ_XUL diff --git a/mozilla/editor/composer/src/nsComposerRegistration.cpp b/mozilla/editor/composer/src/nsComposerRegistration.cpp index 8d814089a8c..6a714c46b19 100644 --- a/mozilla/editor/composer/src/nsComposerRegistration.cpp +++ b/mozilla/editor/composer/src/nsComposerRegistration.cpp @@ -47,7 +47,7 @@ #include "nsIControllerContext.h" #include "nsIControllerCommandTable.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #define NS_HTMLEDITOR_COMMANDTABLE_CID \ { 0x7a727843, 0x6ae1, 0x11d7, { 0xa5eb, 0x00, 0x03, 0x93, 0x63, 0x65, 0x92 } } diff --git a/mozilla/editor/composer/src/nsEditorParserObserver.cpp b/mozilla/editor/composer/src/nsEditorParserObserver.cpp index 44167bbae74..5f68d75340e 100644 --- a/mozilla/editor/composer/src/nsEditorParserObserver.cpp +++ b/mozilla/editor/composer/src/nsEditorParserObserver.cpp @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIParserService.h" #include "nsEditorParserObserver.h" diff --git a/mozilla/editor/composer/src/nsEditorSpellCheck.cpp b/mozilla/editor/composer/src/nsEditorSpellCheck.cpp index 99f561b870a..d5b992dfd66 100644 --- a/mozilla/editor/composer/src/nsEditorSpellCheck.cpp +++ b/mozilla/editor/composer/src/nsEditorSpellCheck.cpp @@ -51,7 +51,7 @@ #include "nsIPrefBranch.h" #include "nsIPrefService.h" #include "nsISupportsPrimitives.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIChromeRegistry.h" #include "nsString.h" #include "nsReadableUtils.h" diff --git a/mozilla/editor/libeditor/base/nsEditor.cpp b/mozilla/editor/libeditor/base/nsEditor.cpp index f494910b08b..0bc68aed234 100644 --- a/mozilla/editor/libeditor/base/nsEditor.cpp +++ b/mozilla/editor/libeditor/base/nsEditor.cpp @@ -80,7 +80,7 @@ #include "nsITextContent.h" #include "nsIContent.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" // transactions the editor knows how to build #include "TransactionFactory.h" diff --git a/mozilla/editor/libeditor/text/nsPlaintextDataTransfer.cpp b/mozilla/editor/libeditor/text/nsPlaintextDataTransfer.cpp index 49705519a81..cc54ab584f0 100644 --- a/mozilla/editor/libeditor/text/nsPlaintextDataTransfer.cpp +++ b/mozilla/editor/libeditor/text/nsPlaintextDataTransfer.cpp @@ -47,7 +47,7 @@ #include "nsIDOMMouseEvent.h" #include "nsISelection.h" #include "nsCRT.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIDOMRange.h" #include "nsIDOMNSRange.h" diff --git a/mozilla/embedding/browser/activex/src/plugin/PrefObserver.cpp b/mozilla/embedding/browser/activex/src/plugin/PrefObserver.cpp index 09ef3567872..7ec3b5dfd54 100644 --- a/mozilla/embedding/browser/activex/src/plugin/PrefObserver.cpp +++ b/mozilla/embedding/browser/activex/src/plugin/PrefObserver.cpp @@ -40,7 +40,7 @@ #include #include "npapi.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsISupportsUtils.h" #include "nsIPrefService.h" #include "nsIPrefBranchInternal.h" diff --git a/mozilla/embedding/browser/activex/src/plugin/XPCBrowser.cpp b/mozilla/embedding/browser/activex/src/plugin/XPCBrowser.cpp index 41bd0d0362c..2cb461ebb19 100644 --- a/mozilla/embedding/browser/activex/src/plugin/XPCBrowser.cpp +++ b/mozilla/embedding/browser/activex/src/plugin/XPCBrowser.cpp @@ -42,7 +42,7 @@ #include "nsCOMPtr.h" #include "nsIInterfaceRequestorUtils.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsString.h" #include "nsIPrefBranch.h" #include "nsIPrefService.h" diff --git a/mozilla/embedding/browser/activex/src/plugin/XPConnect.cpp b/mozilla/embedding/browser/activex/src/plugin/XPConnect.cpp index 6d97cb32dd8..d3abf9aa308 100644 --- a/mozilla/embedding/browser/activex/src/plugin/XPConnect.cpp +++ b/mozilla/embedding/browser/activex/src/plugin/XPConnect.cpp @@ -43,7 +43,7 @@ #include "nsCOMPtr.h" #include "nsComponentManagerUtils.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIMozAxPlugin.h" #include "nsIClassInfo.h" diff --git a/mozilla/embedding/browser/activex/src/plugin/XPConnect.h b/mozilla/embedding/browser/activex/src/plugin/XPConnect.h index 879486407aa..5c793d049fb 100644 --- a/mozilla/embedding/browser/activex/src/plugin/XPConnect.h +++ b/mozilla/embedding/browser/activex/src/plugin/XPConnect.h @@ -50,7 +50,7 @@ #include "nsCOMPtr.h" #include "nsIClassInfo.h" #include "nsIMozAxPlugin.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIURI.h" #include "ControlEventSink.h" diff --git a/mozilla/embedding/browser/gtk/src/EmbedContentListener.cpp b/mozilla/embedding/browser/gtk/src/EmbedContentListener.cpp index ae823a1d2fe..e8129f31d3f 100644 --- a/mozilla/embedding/browser/gtk/src/EmbedContentListener.cpp +++ b/mozilla/embedding/browser/gtk/src/EmbedContentListener.cpp @@ -44,7 +44,7 @@ #include "EmbedPrivate.h" #include "nsICategoryManager.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" EmbedContentListener::EmbedContentListener(void) { diff --git a/mozilla/embedding/browser/photon/src/EmbedContentListener.cpp b/mozilla/embedding/browser/photon/src/EmbedContentListener.cpp index d61f940dae1..89401538b56 100644 --- a/mozilla/embedding/browser/photon/src/EmbedContentListener.cpp +++ b/mozilla/embedding/browser/photon/src/EmbedContentListener.cpp @@ -31,7 +31,7 @@ #include "PtMozilla.h" #include "nsICategoryManager.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" EmbedContentListener::EmbedContentListener(void) { diff --git a/mozilla/embedding/browser/powerplant/source/CBrowserChrome.cpp b/mozilla/embedding/browser/powerplant/source/CBrowserChrome.cpp index 643b4692e4e..f31213ac49c 100644 --- a/mozilla/embedding/browser/powerplant/source/CBrowserChrome.cpp +++ b/mozilla/embedding/browser/powerplant/source/CBrowserChrome.cpp @@ -54,7 +54,7 @@ #include "nsIDOMDocument.h" #include "nsIDOMElement.h" #include "nsIWindowWatcher.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "UMacUnicode.h" #include "ApplIDs.h" diff --git a/mozilla/embedding/browser/powerplant/source/CPrintAttachment.cpp b/mozilla/embedding/browser/powerplant/source/CPrintAttachment.cpp index 317bc5b8fda..edab874f35a 100644 --- a/mozilla/embedding/browser/powerplant/source/CPrintAttachment.cpp +++ b/mozilla/embedding/browser/powerplant/source/CPrintAttachment.cpp @@ -43,7 +43,7 @@ // Gecko #include "nsIPrintingPromptService.h" #include "nsIDOMWindow.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIWebBrowserPrint.h" #include "nsIInterfaceRequestorUtils.h" #include "nsIWebProgressListener.h" diff --git a/mozilla/embedding/browser/powerplant/source/CWindowCreator.cpp b/mozilla/embedding/browser/powerplant/source/CWindowCreator.cpp index 733df949f65..625f17452eb 100644 --- a/mozilla/embedding/browser/powerplant/source/CWindowCreator.cpp +++ b/mozilla/embedding/browser/powerplant/source/CWindowCreator.cpp @@ -39,7 +39,7 @@ #include "CWindowCreator.h" #include "nsIWindowWatcher.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIWebBrowserSetup.h" #include "nsIPrefBranch.h" #include "nsIURI.h" diff --git a/mozilla/embedding/browser/qt/src/EmbedContentListener.cpp b/mozilla/embedding/browser/qt/src/EmbedContentListener.cpp index 04a03756913..8e0dae101bc 100644 --- a/mozilla/embedding/browser/qt/src/EmbedContentListener.cpp +++ b/mozilla/embedding/browser/qt/src/EmbedContentListener.cpp @@ -45,7 +45,7 @@ #include "qgeckoembed.h" #include "nsICategoryManager.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" EmbedContentListener::EmbedContentListener(QGeckoEmbed *aOwner) { diff --git a/mozilla/embedding/components/commandhandler/src/nsCommandManager.cpp b/mozilla/embedding/components/commandhandler/src/nsCommandManager.cpp index d561b4a9760..ef0efacd1be 100644 --- a/mozilla/embedding/components/commandhandler/src/nsCommandManager.cpp +++ b/mozilla/embedding/components/commandhandler/src/nsCommandManager.cpp @@ -44,7 +44,7 @@ #include "nsIComponentManager.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIScriptSecurityManager.h" #include "nsIDOMDocument.h" diff --git a/mozilla/embedding/components/find/src/nsFind.cpp b/mozilla/embedding/components/find/src/nsFind.cpp index e9f331e683f..7cf2b80ce5e 100644 --- a/mozilla/embedding/components/find/src/nsFind.cpp +++ b/mozilla/embedding/components/find/src/nsFind.cpp @@ -60,7 +60,7 @@ #include "nsString.h" #include "nsIAtom.h" #include "nsParserCIID.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsUnicharUtils.h" #include "nsIDOMElement.h" #include "nsCRT.h" diff --git a/mozilla/embedding/minimo/popuplite/nsSimplePopupBlocker.cpp b/mozilla/embedding/minimo/popuplite/nsSimplePopupBlocker.cpp index 1c24809dbe9..043ccd69ac4 100644 --- a/mozilla/embedding/minimo/popuplite/nsSimplePopupBlocker.cpp +++ b/mozilla/embedding/minimo/popuplite/nsSimplePopupBlocker.cpp @@ -40,7 +40,7 @@ #include "nsString.h" #include "nsIPopupWindowManager.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIModule.h" #include "nsIGenericFactory.h" diff --git a/mozilla/embedding/qa/mozembed/src/mozEmbed.cpp b/mozilla/embedding/qa/mozembed/src/mozEmbed.cpp index 8e901a564de..54516bf63ad 100644 --- a/mozilla/embedding/qa/mozembed/src/mozEmbed.cpp +++ b/mozilla/embedding/qa/mozembed/src/mozEmbed.cpp @@ -65,7 +65,7 @@ #include "nsIWebBrowser.h" #include "nsIComponentManager.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIEmbeddingSiteWindow.h" #include "nsIWebNavigation.h" #include "nsIWebBrowserChrome.h" diff --git a/mozilla/embedding/qa/mozembed/src/nsQAWindowCreator.cpp b/mozilla/embedding/qa/mozembed/src/nsQAWindowCreator.cpp index 572d8ba25c9..87aed207363 100644 --- a/mozilla/embedding/qa/mozembed/src/nsQAWindowCreator.cpp +++ b/mozilla/embedding/qa/mozembed/src/nsQAWindowCreator.cpp @@ -36,7 +36,7 @@ * ***** END LICENSE BLOCK ***** */ #include "nsCOMPtr.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIWebBrowserChrome.h" #include "nsQAWindowCreator.h" #include "nsIQABrowserUIGlue.h" diff --git a/mozilla/embedding/tests/mfcembed/BrowserView.cpp b/mozilla/embedding/tests/mfcembed/BrowserView.cpp index c59e2a0777d..b3d860b23c5 100644 --- a/mozilla/embedding/tests/mfcembed/BrowserView.cpp +++ b/mozilla/embedding/tests/mfcembed/BrowserView.cpp @@ -65,7 +65,7 @@ // Mozilla Includes #include "nsIIOService.h" #include "nsIWidget.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsComponentManagerUtils.h" #include "nsMemory.h" #include "nsXPCOM.h" diff --git a/mozilla/embedding/tests/mfcembed/MfcEmbed.cpp b/mozilla/embedding/tests/mfcembed/MfcEmbed.cpp index f83d0ae181b..bc23358e2e7 100644 --- a/mozilla/embedding/tests/mfcembed/MfcEmbed.cpp +++ b/mozilla/embedding/tests/mfcembed/MfcEmbed.cpp @@ -52,7 +52,7 @@ #include "nsMemory.h" #include "nsIComponentRegistrar.h" #include "nsIFactory.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "BrowserFrm.h" #include "EditorFrm.h" #include "winEmbedFileLocProvider.h" diff --git a/mozilla/embedding/tests/mfcembed/MostRecentUrls.cpp b/mozilla/embedding/tests/mfcembed/MostRecentUrls.cpp index 55a10d986d6..eb2a1074d19 100644 --- a/mozilla/embedding/tests/mfcembed/MostRecentUrls.cpp +++ b/mozilla/embedding/tests/mfcembed/MostRecentUrls.cpp @@ -41,7 +41,7 @@ #include "StdAfx.h" #include "nsIFile.h" #include "nsILocalFile.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsAppDirectoryServiceDefs.h" #include "nsDirectoryServiceUtils.h" #include "MostRecentUrls.h" diff --git a/mozilla/embedding/tests/mfcembed/ProfileMgr.cpp b/mozilla/embedding/tests/mfcembed/ProfileMgr.cpp index 656cec56b9a..f2fe8d4e611 100644 --- a/mozilla/embedding/tests/mfcembed/ProfileMgr.cpp +++ b/mozilla/embedding/tests/mfcembed/ProfileMgr.cpp @@ -38,7 +38,7 @@ #include "nsEmbedString.h" #include "nsIRegistry.h" #include "nsIProfile.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsComponentManagerUtils.h" #include "nsCOMPtr.h" #include "nsMemory.h" diff --git a/mozilla/embedding/tests/mfcembed/ProfilesDlg.cpp b/mozilla/embedding/tests/mfcembed/ProfilesDlg.cpp index be8b22c54f8..cd0243322f1 100644 --- a/mozilla/embedding/tests/mfcembed/ProfilesDlg.cpp +++ b/mozilla/embedding/tests/mfcembed/ProfilesDlg.cpp @@ -38,7 +38,7 @@ // Mozilla #include "nsIProfile.h" #include "nsIServiceManager.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsMemory.h" #ifdef _DEBUG diff --git a/mozilla/embedding/tests/mfcembed/winEmbedFileLocProvider.cpp b/mozilla/embedding/tests/mfcembed/winEmbedFileLocProvider.cpp index 55af558f72c..6320395b7ac 100644 --- a/mozilla/embedding/tests/mfcembed/winEmbedFileLocProvider.cpp +++ b/mozilla/embedding/tests/mfcembed/winEmbedFileLocProvider.cpp @@ -37,7 +37,7 @@ #include "nsDirectoryServiceDefs.h" #include "nsILocalFile.h" #include "nsIProperties.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include #include diff --git a/mozilla/extensions/cookie/nsPopupWindowManager.cpp b/mozilla/extensions/cookie/nsPopupWindowManager.cpp index 36b3f9e7967..1b8922c0a55 100644 --- a/mozilla/extensions/cookie/nsPopupWindowManager.cpp +++ b/mozilla/extensions/cookie/nsPopupWindowManager.cpp @@ -46,7 +46,7 @@ #include "nsIPrefBranch.h" #include "nsIPrefBranchInternal.h" #include "nsIPrefService.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIURI.h" /** diff --git a/mozilla/extensions/inspector/base/src/inDeepTreeWalker.cpp b/mozilla/extensions/inspector/base/src/inDeepTreeWalker.cpp index 6435ab26c26..a357eefa2d2 100644 --- a/mozilla/extensions/inspector/base/src/inDeepTreeWalker.cpp +++ b/mozilla/extensions/inspector/base/src/inDeepTreeWalker.cpp @@ -42,7 +42,7 @@ #include "nsIDOMDocument.h" #include "nsIDOMNodeFilter.h" #include "nsIDOMNodeList.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "inIDOMUtils.h" /***************************************************************************** diff --git a/mozilla/extensions/transformiix/source/xslt/txInstructions.cpp b/mozilla/extensions/transformiix/source/xslt/txInstructions.cpp index 1306c829730..2412f0f3147 100644 --- a/mozilla/extensions/transformiix/source/xslt/txInstructions.cpp +++ b/mozilla/extensions/transformiix/source/xslt/txInstructions.cpp @@ -44,7 +44,7 @@ #include "txNodeSetContext.h" #include "txTextHandler.h" #include "nsIConsoleService.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "txStringUtils.h" #include "txAtoms.h" #include "txRtfHandler.h" diff --git a/mozilla/extensions/tridentprofile/src/nsTridentPreferencesWin.cpp b/mozilla/extensions/tridentprofile/src/nsTridentPreferencesWin.cpp index c04abb18248..378d2f5abfb 100644 --- a/mozilla/extensions/tridentprofile/src/nsTridentPreferencesWin.cpp +++ b/mozilla/extensions/tridentprofile/src/nsTridentPreferencesWin.cpp @@ -55,7 +55,7 @@ #include "nsILocalFile.h" #include "nsIPrefService.h" #include "nsIPrefBranch.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsISimpleEnumerator.h" #include "nsITridentProfileMigrator.h" diff --git a/mozilla/extensions/webdav/src/nsWebDAVService.cpp b/mozilla/extensions/webdav/src/nsWebDAVService.cpp index 371b5b703f9..63836467b71 100644 --- a/mozilla/extensions/webdav/src/nsWebDAVService.cpp +++ b/mozilla/extensions/webdav/src/nsWebDAVService.cpp @@ -43,7 +43,7 @@ #include "nsIWebDAVService.h" #include "nsWebDAVServiceCID.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIHttpChannel.h" #include "nsIIOService.h" diff --git a/mozilla/gfx/src/cairo/nsFontMetricsUtils.cpp b/mozilla/gfx/src/cairo/nsFontMetricsUtils.cpp index 4e7c6e81849..e72bedcb988 100644 --- a/mozilla/gfx/src/cairo/nsFontMetricsUtils.cpp +++ b/mozilla/gfx/src/cairo/nsFontMetricsUtils.cpp @@ -42,7 +42,7 @@ #ifdef MOZ_ENABLE_XFT #include "nsFontMetricsXft.h" #include "nsIPref.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "prenv.h" #endif /* MOZ_ENABLE_XFT */ diff --git a/mozilla/gfx/src/cairo/nsFontMetricsXft.cpp b/mozilla/gfx/src/cairo/nsFontMetricsXft.cpp index a4b0e69dff4..df104b7c577 100644 --- a/mozilla/gfx/src/cairo/nsFontMetricsXft.cpp +++ b/mozilla/gfx/src/cairo/nsFontMetricsXft.cpp @@ -43,7 +43,7 @@ * ***** END LICENSE BLOCK ***** */ #include "nsISupportsUtils.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIPref.h" #include "nsFontMetricsXft.h" #include "prenv.h" diff --git a/mozilla/gfx/src/gtk/nsFontMetricsPango.cpp b/mozilla/gfx/src/gtk/nsFontMetricsPango.cpp index 9b32382c3d5..98eb9a07b7b 100644 --- a/mozilla/gfx/src/gtk/nsFontMetricsPango.cpp +++ b/mozilla/gfx/src/gtk/nsFontMetricsPango.cpp @@ -40,7 +40,7 @@ #include "nsIDeviceContext.h" #include "nsICharsetConverterManager.h" #include "nsIPref.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #define PANGO_ENABLE_BACKEND #define PANGO_ENABLE_ENGINE diff --git a/mozilla/gfx/src/gtk/nsFontMetricsUtils.cpp b/mozilla/gfx/src/gtk/nsFontMetricsUtils.cpp index 9777e561bf6..57595795015 100644 --- a/mozilla/gfx/src/gtk/nsFontMetricsUtils.cpp +++ b/mozilla/gfx/src/gtk/nsFontMetricsUtils.cpp @@ -42,7 +42,7 @@ #ifdef MOZ_ENABLE_XFT #include "nsFontMetricsXft.h" #include "nsIPref.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "prenv.h" #endif /* MOZ_ENABLE_XFT */ diff --git a/mozilla/gfx/src/gtk/nsFontMetricsXft.cpp b/mozilla/gfx/src/gtk/nsFontMetricsXft.cpp index cdbf53f0bab..9cd39e8ee51 100644 --- a/mozilla/gfx/src/gtk/nsFontMetricsXft.cpp +++ b/mozilla/gfx/src/gtk/nsFontMetricsXft.cpp @@ -43,7 +43,7 @@ * ***** END LICENSE BLOCK ***** */ #include "nsISupportsUtils.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIPref.h" #include "nsFontMetricsXft.h" #include "prenv.h" diff --git a/mozilla/gfx/src/mac/nsPrintSettingsX.cpp b/mozilla/gfx/src/mac/nsPrintSettingsX.cpp index 8ceec7c2e59..f09c3e91896 100644 --- a/mozilla/gfx/src/mac/nsPrintSettingsX.cpp +++ b/mozilla/gfx/src/mac/nsPrintSettingsX.cpp @@ -41,7 +41,7 @@ #include "nsIPrefService.h" #include "nsIPrefBranch.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "plbase64.h" #include "prmem.h" diff --git a/mozilla/intl/locale/src/nsLocaleService.cpp b/mozilla/intl/locale/src/nsLocaleService.cpp index 0fd3eee55eb..08e807405ba 100644 --- a/mozilla/intl/locale/src/nsLocaleService.cpp +++ b/mozilla/intl/locale/src/nsLocaleService.cpp @@ -40,7 +40,7 @@ #include "nsILocaleService.h" #include "nsLocale.h" #include "nsLocaleCID.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsReadableUtils.h" #include "nsCRT.h" #include "prprf.h" diff --git a/mozilla/intl/lwbrk/tests/TestLineBreak.cpp b/mozilla/intl/lwbrk/tests/TestLineBreak.cpp index 3557401290a..dcd4c97395f 100644 --- a/mozilla/intl/lwbrk/tests/TestLineBreak.cpp +++ b/mozilla/intl/lwbrk/tests/TestLineBreak.cpp @@ -38,7 +38,7 @@ #include "nsXPCOM.h" #include "nsIComponentManager.h" #include "nsISupports.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsILineBreakerFactory.h" #include "nsILineBreaker.h" #include "nsIWordBreakerFactory.h" diff --git a/mozilla/intl/uconv/src/nsWinCharset.cpp b/mozilla/intl/uconv/src/nsWinCharset.cpp index 3440afb6b6c..01f846fb096 100644 --- a/mozilla/intl/uconv/src/nsWinCharset.cpp +++ b/mozilla/intl/uconv/src/nsWinCharset.cpp @@ -44,7 +44,7 @@ #include "nsCOMPtr.h" #include "nsReadableUtils.h" #include "nsLocaleCID.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsITimelineService.h" #include "nsPlatformCharset.h" diff --git a/mozilla/intl/uconv/ucvko/nsUnicodeToJamoTTF.cpp b/mozilla/intl/uconv/ucvko/nsUnicodeToJamoTTF.cpp index e73e203a1ac..d515c5dc6d1 100644 --- a/mozilla/intl/uconv/ucvko/nsUnicodeToJamoTTF.cpp +++ b/mozilla/intl/uconv/ucvko/nsUnicodeToJamoTTF.cpp @@ -56,7 +56,7 @@ #include "nsISupportsUtils.h" #include "nsCOMPtr.h" #include "nsIUnicodeDecoder.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsICharsetConverterManager.h" #include "nsICharRepresentable.h" #include diff --git a/mozilla/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp b/mozilla/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp index 169b3e58194..6ae285b0285 100644 --- a/mozilla/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp +++ b/mozilla/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp @@ -42,7 +42,7 @@ #include "ipcMessageReader.h" #include "ipcLog.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIInterfaceInfo.h" #include "nsIInterfaceInfoManager.h" #include "nsAutoPtr.h" diff --git a/mozilla/ipc/ipcd/extensions/lock/test/TestIPCLocks.cpp b/mozilla/ipc/ipcd/extensions/lock/test/TestIPCLocks.cpp index f35e843445f..907a1e76dc2 100644 --- a/mozilla/ipc/ipcd/extensions/lock/test/TestIPCLocks.cpp +++ b/mozilla/ipc/ipcd/extensions/lock/test/TestIPCLocks.cpp @@ -46,7 +46,7 @@ #include #include "ipcILockService.h" #include "ipcLockCID.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIEventQueueService.h" #include "nsCOMPtr.h" #include "nsXPCOM.h" diff --git a/mozilla/java/webclient/src_moz/NavigationImpl.cpp b/mozilla/java/webclient/src_moz/NavigationImpl.cpp index 7c337d806f0..953665e4697 100644 --- a/mozilla/java/webclient/src_moz/NavigationImpl.cpp +++ b/mozilla/java/webclient/src_moz/NavigationImpl.cpp @@ -30,7 +30,7 @@ #include "org_mozilla_webclient_impl_wrapper_0005fnative_NavigationImpl.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIIOService.h" #include "nsIURI.h" #include "nsString.h" diff --git a/mozilla/layout/style/nsLayoutStylesheetCache.cpp b/mozilla/layout/style/nsLayoutStylesheetCache.cpp index 9d3525aeeb5..c05a02211ec 100644 --- a/mozilla/layout/style/nsLayoutStylesheetCache.cpp +++ b/mozilla/layout/style/nsLayoutStylesheetCache.cpp @@ -43,7 +43,7 @@ #include "nsLayoutCID.h" #include "nsNetUtil.h" #include "nsIObserverService.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" NS_IMPL_ISUPPORTS1(nsLayoutStylesheetCache, nsIObserver) diff --git a/mozilla/mail/components/migration/src/nsMailProfileMigratorUtils.cpp b/mozilla/mail/components/migration/src/nsMailProfileMigratorUtils.cpp index 6dde29f7d10..4a633a05608 100644 --- a/mozilla/mail/components/migration/src/nsMailProfileMigratorUtils.cpp +++ b/mozilla/mail/components/migration/src/nsMailProfileMigratorUtils.cpp @@ -40,7 +40,7 @@ #include "nsIProperties.h" #include "nsIProfileMigrator.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsAppDirectoryServiceDefs.h" #include "nsXPCOMCID.h" #include "nsCRT.h" diff --git a/mozilla/modules/libpr0n/build/nsImageModule.cpp b/mozilla/modules/libpr0n/build/nsImageModule.cpp index 1632eadc937..122cf4c6c1d 100644 --- a/mozilla/modules/libpr0n/build/nsImageModule.cpp +++ b/mozilla/modules/libpr0n/build/nsImageModule.cpp @@ -49,7 +49,7 @@ #include "nsIModule.h" #include "nsICategoryManager.h" #include "nsXPCOMCID.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "imgCache.h" #include "imgContainer.h" diff --git a/mozilla/modules/libpref/src/nsSharedPrefHandler.cpp b/mozilla/modules/libpref/src/nsSharedPrefHandler.cpp index 1df555b118b..5b583fc1512 100644 --- a/mozilla/modules/libpref/src/nsSharedPrefHandler.cpp +++ b/mozilla/modules/libpref/src/nsSharedPrefHandler.cpp @@ -39,7 +39,7 @@ #include "nsSharedPrefHandler.h" #include "nsPrefService.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsILocalFile.h" #include "nsAppDirectoryServiceDefs.h" #include "nsReadableUtils.h" diff --git a/mozilla/netwerk/base/public/nsNetUtil.h b/mozilla/netwerk/base/public/nsNetUtil.h index 70f7afcdcfe..01dace806b2 100644 --- a/mozilla/netwerk/base/public/nsNetUtil.h +++ b/mozilla/netwerk/base/public/nsNetUtil.h @@ -86,11 +86,11 @@ #include "nsInterfaceRequestorAgg.h" // Helper, to simplify getting the I/O service. -inline const nsGetServiceByCID +inline const nsGetServiceByCIDWithError do_GetIOService(nsresult* error = 0) { static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); - return nsGetServiceByCID(kIOServiceCID, 0, error); + return nsGetServiceByCIDWithError(kIOServiceCID, error); } // private little helper function... don't call this directly! diff --git a/mozilla/uriloader/exthandler/nsExternalProtocolHandler.cpp b/mozilla/uriloader/exthandler/nsExternalProtocolHandler.cpp index 759996ff135..988ceff9185 100644 --- a/mozilla/uriloader/exthandler/nsExternalProtocolHandler.cpp +++ b/mozilla/uriloader/exthandler/nsExternalProtocolHandler.cpp @@ -45,7 +45,7 @@ #include "nsReadableUtils.h" #include "nsCOMPtr.h" #include "nsIServiceManager.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIInterfaceRequestor.h" #include "nsIInterfaceRequestorUtils.h" #include "nsIStringBundle.h" diff --git a/mozilla/view/src/nsScrollPortView.cpp b/mozilla/view/src/nsScrollPortView.cpp index 24822b56e65..849425ec401 100644 --- a/mozilla/view/src/nsScrollPortView.cpp +++ b/mozilla/view/src/nsScrollPortView.cpp @@ -52,7 +52,7 @@ #include "nsIPrefBranch.h" #include "nsIPrefService.h" #include "nsCOMPtr.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include diff --git a/mozilla/widget/src/gtk2/nsAppShell.cpp b/mozilla/widget/src/gtk2/nsAppShell.cpp index 635b4de1abb..e6d5ab99407 100644 --- a/mozilla/widget/src/gtk2/nsAppShell.cpp +++ b/mozilla/widget/src/gtk2/nsAppShell.cpp @@ -38,7 +38,7 @@ #include "nsAppShell.h" #include "nsIEventQueueService.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "plhash.h" #include "prenv.h" diff --git a/mozilla/widget/src/qt/nsAppShell.cpp b/mozilla/widget/src/qt/nsAppShell.cpp index 300435845ef..12afd4e6bb7 100644 --- a/mozilla/widget/src/qt/nsAppShell.cpp +++ b/mozilla/widget/src/qt/nsAppShell.cpp @@ -42,7 +42,7 @@ #include "nsEventQueueWatcher.h" #include "nsIEventQueueService.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIEventQueue.h" #include diff --git a/mozilla/widget/src/xpwidgets/nsBaseWidget.cpp b/mozilla/widget/src/xpwidgets/nsBaseWidget.cpp index b13fdc0ebf7..c5f29613e64 100644 --- a/mozilla/widget/src/xpwidgets/nsBaseWidget.cpp +++ b/mozilla/widget/src/xpwidgets/nsBaseWidget.cpp @@ -44,7 +44,7 @@ #include "nsGfxCIID.h" #include "nsWidgetsCID.h" #include "nsIFullScreen.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIScreenManager.h" #include "nsAppDirectoryServiceDefs.h" diff --git a/mozilla/xpcom/build/nsOS2VACLegacy.cpp b/mozilla/xpcom/build/nsOS2VACLegacy.cpp index 4de75d46c9b..164ea3acc10 100644 --- a/mozilla/xpcom/build/nsOS2VACLegacy.cpp +++ b/mozilla/xpcom/build/nsOS2VACLegacy.cpp @@ -67,7 +67,7 @@ * Header Files * *******************************************************************************/ #include "nscore.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" /******************************************************************************* diff --git a/mozilla/xpcom/components/Makefile.in b/mozilla/xpcom/components/Makefile.in index 218ab0f238a..f20364a65c5 100644 --- a/mozilla/xpcom/components/Makefile.in +++ b/mozilla/xpcom/components/Makefile.in @@ -66,7 +66,6 @@ endif EXPORTS = \ nsCategoryManagerUtils.h \ nsComponentManagerObsolete.h \ - nsIServiceManagerUtils.h \ nsIServiceManagerObsolete.h \ nsModule.h \ nsNativeComponentLoader.h \ diff --git a/mozilla/xpcom/components/nsCategoryManager.cpp b/mozilla/xpcom/components/nsCategoryManager.cpp index d7202bdb1ab..4fe31324075 100644 --- a/mozilla/xpcom/components/nsCategoryManager.cpp +++ b/mozilla/xpcom/components/nsCategoryManager.cpp @@ -51,7 +51,7 @@ #include "nsIFactory.h" #include "nsIStringEnumerator.h" #include "nsSupportsPrimitives.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIObserver.h" #include "nsReadableUtils.h" #include "nsCRT.h" diff --git a/mozilla/xpcom/components/nsComponentManager.cpp b/mozilla/xpcom/components/nsComponentManager.cpp index bf2dd827111..83bc4527a69 100644 --- a/mozilla/xpcom/components/nsComponentManager.cpp +++ b/mozilla/xpcom/components/nsComponentManager.cpp @@ -217,17 +217,24 @@ nsGetServiceFromCategory::operator()(const nsIID& aIID, void** aInstancePtr) con { nsresult rv; nsXPIDLCString value; - nsCOMPtr serviceManager = - do_QueryInterface(mServiceManager); - // XXX Should we use the provided service manager? - nsCOMPtr catman = - do_GetService(kCategoryManagerCID, &rv); - if (NS_FAILED(rv)) goto error; + nsCOMPtr catman; + nsComponentManagerImpl *compMgr = nsComponentManagerImpl::gComponentManager; + if (!compMgr) { + rv = NS_ERROR_NOT_INITIALIZED; + goto error; + } + if (!mCategory || !mEntry) { // when categories have defaults, use that for null mEntry rv = NS_ERROR_NULL_POINTER; goto error; } + + rv = compMgr->nsComponentManagerImpl::GetService(kCategoryManagerCID, + NS_GET_IID(nsICategoryManager), + getter_AddRefs(catman)); + if (NS_FAILED(rv)) goto error; + /* find the contractID for category.entry */ rv = catman->GetCategoryEntry(mCategory, mEntry, getter_Copies(value)); @@ -236,14 +243,10 @@ nsGetServiceFromCategory::operator()(const nsIID& aIID, void** aInstancePtr) con rv = NS_ERROR_SERVICE_NOT_AVAILABLE; goto error; } - if (serviceManager) { - rv = serviceManager->GetServiceByContractID(value, aIID, (void**)aInstancePtr); - } else { - nsCOMPtr mgr; - NS_GetServiceManager(getter_AddRefs(mgr)); - if (mgr) - rv = mgr->GetServiceByContractID(value, aIID, (void**)aInstancePtr); - } + + rv = compMgr-> + nsComponentManagerImpl::GetServiceByContractID(value, + aIID, aInstancePtr); if (NS_FAILED(rv)) { error: *aInstancePtr = 0; diff --git a/mozilla/xpcom/components/nsIServiceManager.idl b/mozilla/xpcom/components/nsIServiceManager.idl index 200c2a6905e..3574b2a74d6 100644 --- a/mozilla/xpcom/components/nsIServiceManager.idl +++ b/mozilla/xpcom/components/nsIServiceManager.idl @@ -112,7 +112,7 @@ interface nsIServiceManager : nsISupports #ifndef MOZILLA_STRICT_API #include "nsXPCOM.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIServiceManagerObsolete.h" #endif %} diff --git a/mozilla/xpcom/components/nsIServiceManagerUtils.h b/mozilla/xpcom/components/nsIServiceManagerUtils.h deleted file mode 100644 index 5e3ac6885b0..00000000000 --- a/mozilla/xpcom/components/nsIServiceManagerUtils.h +++ /dev/null @@ -1,183 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is XPCOM. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsIServiceManagerUtils_h__ -#define nsIServiceManagerUtils_h__ - -#include "nsIServiceManager.h" -#include "nsIServiceManagerObsolete.h" -#include "nsCOMPtr.h" - -//////////////////////////////////////////////////////////////////////////// -// Using servicemanager with COMPtrs -class NS_COM nsGetServiceByCID : public nsCOMPtr_helper -{ - public: - nsGetServiceByCID( const nsCID& aCID, nsISupports* aServiceManager, nsresult* aErrorPtr ) - : mCID(aCID), - mServiceManager(aServiceManager), - mErrorPtr(aErrorPtr) - { - // nothing else to do - } - - virtual nsresult NS_FASTCALL operator()( const nsIID&, void** ) const; - - private: - const nsCID& mCID; - nsISupports* mServiceManager; - nsresult* mErrorPtr; -}; - -inline -const nsGetServiceByCID -do_GetService( const nsCID& aCID, nsresult* error = 0 ) -{ - return nsGetServiceByCID(aCID, 0, error); -} - -inline -const nsGetServiceByCID -do_GetService( const nsCID& aCID, nsISupports* aServiceManager, nsresult* error = 0 ) -{ - return nsGetServiceByCID(aCID, aServiceManager, error); -} - -class NS_COM nsGetServiceByContractID : public nsCOMPtr_helper -{ - public: - nsGetServiceByContractID( const char* aContractID, nsISupports* aServiceManager, nsresult* aErrorPtr ) - : mContractID(aContractID), - mServiceManager(aServiceManager), - mErrorPtr(aErrorPtr) - { - // nothing else to do - } - - virtual nsresult NS_FASTCALL operator()( const nsIID&, void** ) const; - - private: - const char* mContractID; - nsISupports* mServiceManager; - nsresult* mErrorPtr; -}; - -inline -const nsGetServiceByContractID -do_GetService( const char* aContractID, nsresult* error = 0 ) -{ - return nsGetServiceByContractID(aContractID, 0, error); -} - -inline -const nsGetServiceByContractID -do_GetService( const char* aContractID, nsISupports* aServiceManager, nsresult* error = 0 ) -{ - return nsGetServiceByContractID(aContractID, aServiceManager, error); -} - -class nsGetServiceFromCategory : public nsCOMPtr_helper -{ - public: - nsGetServiceFromCategory(const char* aCategory, const char* aEntry, - nsISupports* aServiceManager, - nsresult* aErrorPtr) - : mCategory(aCategory), - mEntry(aEntry), - mServiceManager(aServiceManager), - mErrorPtr(aErrorPtr) - { - // nothing else to do - } - - virtual nsresult NS_FASTCALL operator()( const nsIID&, void** ) const; - protected: - const char* mCategory; - const char* mEntry; - nsISupports* mServiceManager; - nsresult* mErrorPtr; -}; - -inline -const nsGetServiceFromCategory -do_GetServiceFromCategory( const char* category, const char* entry, - nsresult* error = 0) -{ - return nsGetServiceFromCategory(category, entry, 0, error); -} - -// type-safe shortcuts for calling |GetService| -template -inline -nsresult -CallGetService( const nsCID &aClass, - DestinationType** aDestination) -{ - NS_PRECONDITION(aDestination, "null parameter"); - - nsCOMPtr mgr; - nsresult rv = NS_GetServiceManager(getter_AddRefs(mgr)); - - if (NS_FAILED(rv)) - return rv; - - return mgr->GetService(aClass, - NS_GET_IID(DestinationType), - NS_REINTERPRET_CAST(void**, aDestination)); -} - -template -inline -nsresult -CallGetService( const char *aContractID, - DestinationType** aDestination) -{ - NS_PRECONDITION(aContractID, "null parameter"); - NS_PRECONDITION(aDestination, "null parameter"); - - nsCOMPtr mgr; - nsresult rv = NS_GetServiceManager(getter_AddRefs(mgr)); - - if (NS_FAILED(rv)) - return rv; - - return mgr->GetServiceByContractID(aContractID, - NS_GET_IID(DestinationType), - NS_REINTERPRET_CAST(void**, aDestination)); -} - -#endif diff --git a/mozilla/xpcom/glue/nsCOMPtr.cpp b/mozilla/xpcom/glue/nsCOMPtr.cpp index cac3c6d4169..53c055eb805 100644 --- a/mozilla/xpcom/glue/nsCOMPtr.cpp +++ b/mozilla/xpcom/glue/nsCOMPtr.cpp @@ -107,6 +107,42 @@ nsCOMPtr_base::assign_from_qi_with_error( const nsQueryInterfaceWithError& qi, c assign_assuming_AddRef(newRawPtr); } +void +nsCOMPtr_base::assign_from_gs_cid( const nsGetServiceByCID gs, const nsIID& iid ) + { + nsISupports* newRawPtr; + if ( NS_FAILED( gs(iid, NS_REINTERPRET_CAST(void**, &newRawPtr)) ) ) + newRawPtr = 0; + assign_assuming_AddRef(newRawPtr); + } + +void +nsCOMPtr_base::assign_from_gs_cid_with_error( const nsGetServiceByCIDWithError& gs, const nsIID& iid ) + { + nsISupports* newRawPtr; + if ( NS_FAILED( gs(iid, NS_REINTERPRET_CAST(void**, &newRawPtr)) ) ) + newRawPtr = 0; + assign_assuming_AddRef(newRawPtr); + } + +void +nsCOMPtr_base::assign_from_gs_contractid( const nsGetServiceByContractID gs, const nsIID& iid ) + { + nsISupports* newRawPtr; + if ( NS_FAILED( gs(iid, NS_REINTERPRET_CAST(void**, &newRawPtr)) ) ) + newRawPtr = 0; + assign_assuming_AddRef(newRawPtr); + } + +void +nsCOMPtr_base::assign_from_gs_contractid_with_error( const nsGetServiceByContractIDWithError& gs, const nsIID& iid ) + { + nsISupports* newRawPtr; + if ( NS_FAILED( gs(iid, NS_REINTERPRET_CAST(void**, &newRawPtr)) ) ) + newRawPtr = 0; + assign_assuming_AddRef(newRawPtr); + } + void nsCOMPtr_base::assign_from_helper( const nsCOMPtr_helper& helper, const nsIID& iid ) { diff --git a/mozilla/xpcom/glue/nsCOMPtr.h b/mozilla/xpcom/glue/nsCOMPtr.h index 658eca1ca47..ae7e485be4a 100644 --- a/mozilla/xpcom/glue/nsCOMPtr.h +++ b/mozilla/xpcom/glue/nsCOMPtr.h @@ -409,6 +409,71 @@ do_QueryInterface( already_AddRefed&, nsresult* ) } +//////////////////////////////////////////////////////////////////////////// +// Using servicemanager with COMPtrs +class NS_COM_GLUE nsGetServiceByCID +{ + public: + nsGetServiceByCID(const nsCID& aCID) + : mCID(aCID) + { + // nothing else to do + } + + nsresult NS_FASTCALL operator()( const nsIID&, void** ) const; + + private: + const nsCID& mCID; +}; + +class NS_COM_GLUE nsGetServiceByCIDWithError +{ + public: + nsGetServiceByCIDWithError( const nsCID& aCID, nsresult* aErrorPtr ) + : mCID(aCID), + mErrorPtr(aErrorPtr) + { + // nothing else to do + } + + nsresult NS_FASTCALL operator()( const nsIID&, void** ) const; + + private: + const nsCID& mCID; + nsresult* mErrorPtr; +}; + +class NS_COM_GLUE nsGetServiceByContractID +{ + public: + nsGetServiceByContractID(const char* aContractID) + : mContractID(aContractID) + { + // nothing else to do + } + + nsresult NS_FASTCALL operator()( const nsIID&, void** ) const; + + private: + const char* mContractID; +}; + +class NS_COM_GLUE nsGetServiceByContractIDWithError +{ + public: + nsGetServiceByContractIDWithError(const char* aContractID, nsresult* aErrorPtr) + : mContractID(aContractID), + mErrorPtr(aErrorPtr) + { + // nothing else to do + } + + nsresult NS_FASTCALL operator()( const nsIID&, void** ) const; + + private: + const char* mContractID; + nsresult* mErrorPtr; +}; class nsCOMPtr_base /* @@ -437,6 +502,10 @@ class nsCOMPtr_base NS_COM_GLUE void NS_FASTCALL assign_with_AddRef( nsISupports* ); NS_COM_GLUE void NS_FASTCALL assign_from_qi( const nsQueryInterface, const nsIID& ); NS_COM_GLUE void NS_FASTCALL assign_from_qi_with_error( const nsQueryInterfaceWithError&, const nsIID& ); + NS_COM_GLUE void NS_FASTCALL assign_from_gs_cid( const nsGetServiceByCID, const nsIID& ); + NS_COM_GLUE void NS_FASTCALL assign_from_gs_cid_with_error( const nsGetServiceByCIDWithError&, const nsIID& ); + NS_COM_GLUE void NS_FASTCALL assign_from_gs_contractid( const nsGetServiceByContractID, const nsIID& ); + NS_COM_GLUE void NS_FASTCALL assign_from_gs_contractid_with_error( const nsGetServiceByContractIDWithError&, const nsIID& ); NS_COM_GLUE void NS_FASTCALL assign_from_helper( const nsCOMPtr_helper&, const nsIID& ); NS_COM_GLUE void** NS_FASTCALL begin_assignment(); @@ -481,6 +550,10 @@ class nsCOMPtr void assign_with_AddRef( nsISupports* ); void assign_from_qi( const nsQueryInterface, const nsIID& ); void assign_from_qi_with_error( const nsQueryInterfaceWithError&, const nsIID& ); + void assign_from_gs_cid( const nsGetServiceByCID, const nsIID& ); + void assign_from_gs_cid_with_error( const nsGetServiceByCIDWithError&, const nsIID& ); + void assign_from_gs_contractid( const nsGetServiceByContractID, const nsIID& ); + void assign_from_gs_contractid_with_error( const nsGetServiceByContractIDWithError&, const nsIID& ); void assign_from_helper( const nsCOMPtr_helper&, const nsIID& ); void** begin_assignment(); @@ -580,6 +653,38 @@ class nsCOMPtr assign_from_qi_with_error(qi, NS_GET_IID(T)); } + nsCOMPtr( const nsGetServiceByCID gs ) + : NSCAP_CTOR_BASE(0) + // construct from |do_GetService(cid_expr)| + { + NSCAP_LOG_ASSIGNMENT(this, 0); + assign_from_gs_cid(gs, NS_GET_IID(T)); + } + + nsCOMPtr( const nsGetServiceByCIDWithError& gs ) + : NSCAP_CTOR_BASE(0) + // construct from |do_GetService(cid_expr, &rv)| + { + NSCAP_LOG_ASSIGNMENT(this, 0); + assign_from_gs_cid_with_error(gs, NS_GET_IID(T)); + } + + nsCOMPtr( const nsGetServiceByContractID gs ) + : NSCAP_CTOR_BASE(0) + // construct from |do_GetService(contractid_expr)| + { + NSCAP_LOG_ASSIGNMENT(this, 0); + assign_from_gs_contractid(gs, NS_GET_IID(T)); + } + + nsCOMPtr( const nsGetServiceByContractIDWithError& gs ) + : NSCAP_CTOR_BASE(0) + // construct from |do_GetService(contractid_expr, &rv)| + { + NSCAP_LOG_ASSIGNMENT(this, 0); + assign_from_gs_contractid_with_error(gs, NS_GET_IID(T)); + } + nsCOMPtr( const nsCOMPtr_helper& helper ) : NSCAP_CTOR_BASE(0) // ...and finally, anything else we might need to construct from @@ -635,6 +740,38 @@ class nsCOMPtr return *this; } + nsCOMPtr& + operator=( const nsGetServiceByCID rhs ) + // assign from |do_GetService(cid_expr)| + { + assign_from_gs_cid(rhs, NS_GET_IID(T)); + return *this; + } + + nsCOMPtr& + operator=( const nsGetServiceByCIDWithError& rhs ) + // assign from |do_GetService(cid_expr, &rv)| + { + assign_from_gs_cid_with_error(rhs, NS_GET_IID(T)); + return *this; + } + + nsCOMPtr& + operator=( const nsGetServiceByContractID rhs ) + // assign from |do_GetService(contractid_expr)| + { + assign_from_gs_contractid(rhs, NS_GET_IID(T)); + return *this; + } + + nsCOMPtr& + operator=( const nsGetServiceByContractIDWithError& rhs ) + // assign from |do_GetService(contractid_expr, &rv)| + { + assign_from_gs_contractid_with_error(rhs, NS_GET_IID(T)); + return *this; + } + nsCOMPtr& operator=( const nsCOMPtr_helper& rhs ) // ...and finally, anything else we might need to assign from @@ -837,6 +974,38 @@ class nsCOMPtr assign_from_qi_with_error(qi, NS_GET_IID(nsISupports)); } + nsCOMPtr( const nsGetServiceByCID gs ) + : nsCOMPtr_base(0) + // assign from |do_GetService(cid_expr)| + { + NSCAP_LOG_ASSIGNMENT(this, 0); + assign_from_gs_cid(gs, NS_GET_IID(nsISupports)); + } + + nsCOMPtr( const nsGetServiceByCIDWithError& gs ) + : nsCOMPtr_base(0) + // assign from |do_GetService(cid_expr, &rv)| + { + NSCAP_LOG_ASSIGNMENT(this, 0); + assign_from_gs_cid_with_error(gs, NS_GET_IID(nsISupports)); + } + + nsCOMPtr( const nsGetServiceByContractID gs ) + : nsCOMPtr_base(0) + // assign from |do_GetService(contractid_expr)| + { + NSCAP_LOG_ASSIGNMENT(this, 0); + assign_from_gs_contractid(gs, NS_GET_IID(nsISupports)); + } + + nsCOMPtr( const nsGetServiceByContractIDWithError& gs ) + : nsCOMPtr_base(0) + // assign from |do_GetService(contractid_expr, &rv)| + { + NSCAP_LOG_ASSIGNMENT(this, 0); + assign_from_gs_contractid_with_error(gs, NS_GET_IID(nsISupports)); + } + nsCOMPtr( const nsCOMPtr_helper& helper ) : nsCOMPtr_base(0) // ...and finally, anything else we might need to construct from @@ -889,6 +1058,38 @@ class nsCOMPtr return *this; } + nsCOMPtr& + operator=( const nsGetServiceByCID rhs ) + // assign from |do_GetService(cid_expr)| + { + assign_from_gs_cid(rhs, NS_GET_IID(nsISupports)); + return *this; + } + + nsCOMPtr& + operator=( const nsGetServiceByCIDWithError& rhs ) + // assign from |do_GetService(cid_expr, &rv)| + { + assign_from_gs_cid_with_error(rhs, NS_GET_IID(nsISupports)); + return *this; + } + + nsCOMPtr& + operator=( const nsGetServiceByContractID rhs ) + // assign from |do_GetService(contractid_expr)| + { + assign_from_gs_contractid(rhs, NS_GET_IID(nsISupports)); + return *this; + } + + nsCOMPtr& + operator=( const nsGetServiceByContractIDWithError& rhs ) + // assign from |do_GetService(contractid_expr, &rv)| + { + assign_from_gs_contractid_with_error(rhs, NS_GET_IID(nsISupports)); + return *this; + } + nsCOMPtr& operator=( const nsCOMPtr_helper& rhs ) // ...and finally, anything else we might need to assign from @@ -1043,6 +1244,46 @@ nsCOMPtr::assign_from_qi_with_error( const nsQueryInterfaceWithError& qi, con assign_assuming_AddRef(newRawPtr); } +template +void +nsCOMPtr::assign_from_gs_cid( const nsGetServiceByCID gs, const nsIID& aIID ) + { + T* newRawPtr; + if ( NS_FAILED( gs(aIID, NS_REINTERPRET_CAST(void**, &newRawPtr)) ) ) + newRawPtr = 0; + assign_assuming_AddRef(newRawPtr); + } + +template +void +nsCOMPtr::assign_from_gs_cid_with_error( const nsGetServiceByCIDWithError& gs, const nsIID& aIID ) + { + T* newRawPtr; + if ( NS_FAILED( gs(aIID, NS_REINTERPRET_CAST(void**, &newRawPtr)) ) ) + newRawPtr = 0; + assign_assuming_AddRef(newRawPtr); + } + +template +void +nsCOMPtr::assign_from_gs_contractid( const nsGetServiceByContractID gs, const nsIID& aIID ) + { + T* newRawPtr; + if ( NS_FAILED( gs(aIID, NS_REINTERPRET_CAST(void**, &newRawPtr)) ) ) + newRawPtr = 0; + assign_assuming_AddRef(newRawPtr); + } + +template +void +nsCOMPtr::assign_from_gs_contractid_with_error( const nsGetServiceByContractIDWithError& gs, const nsIID& aIID ) + { + T* newRawPtr; + if ( NS_FAILED( gs(aIID, NS_REINTERPRET_CAST(void**, &newRawPtr)) ) ) + newRawPtr = 0; + assign_assuming_AddRef(newRawPtr); + } + template void nsCOMPtr::assign_from_helper( const nsCOMPtr_helper& helper, const nsIID& aIID ) diff --git a/mozilla/xpcom/glue/nsComponentManagerUtils.cpp b/mozilla/xpcom/glue/nsComponentManagerUtils.cpp index 40b87c68dc2..638d6835eb7 100644 --- a/mozilla/xpcom/glue/nsComponentManagerUtils.cpp +++ b/mozilla/xpcom/glue/nsComponentManagerUtils.cpp @@ -44,7 +44,55 @@ #endif #include "nsComponentManagerUtils.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" + +#ifdef MOZILLA_STRICT_API + +nsresult +CallGetService(const nsCID &aCID, const nsIID &aIID, void **aResult) +{ + nsCOMPtr servMgr; + nsresult status = NS_GetServiceManager(getter_AddRefs(servMgr)); + if (servMgr) + status = servMgr->GetService(aCID, aIID, aResult); + return status; +} + +nsresult +CallGetService(const char *aContractID, const nsIID &aIID, void **aResult) +{ + nsCOMPtr servMgr; + nsresult status = NS_GetServiceManager(getter_AddRefs(servMgr)); + if (servMgr) + status = servMgr->GetServiceByContractID(aContractID, aIID, aResult); + return status; +} + +#else + +#include "nsComponentManager.h" + +nsresult +CallGetService(const nsCID &aCID, const nsIID &aIID, void **aResult) +{ + nsComponentManagerImpl *compMgr = nsComponentManagerImpl::gComponentManager; + NS_ENSURE_TRUE(compMgr, NS_ERROR_NOT_INITIALIZED); + + return compMgr->nsComponentManagerImpl::GetService(aCID, aIID, aResult); +} + +nsresult +CallGetService(const char *aContractID, const nsIID &aIID, void **aResult) +{ + nsComponentManagerImpl *compMgr = nsComponentManagerImpl::gComponentManager; + NS_ENSURE_TRUE(compMgr, NS_ERROR_NOT_INITIALIZED); + + return compMgr-> + nsComponentManagerImpl::GetServiceByContractID(aContractID, + aIID, aResult); +} + +#endif #ifdef MOZILLA_STRICT_API @@ -203,20 +251,24 @@ nsGetClassObjectByContractID::operator()( const nsIID& aIID, void** aInstancePtr nsresult nsGetServiceByCID::operator()( const nsIID& aIID, void** aInstancePtr ) const { - nsresult status = NS_ERROR_FAILURE; - nsCOMPtr serviceManager = - do_QueryInterface(mServiceManager); - if ( serviceManager ) { - status = serviceManager->GetService(mCID, aIID, (void**)aInstancePtr); - } else { - nsCOMPtr mgr; - NS_GetServiceManager(getter_AddRefs(mgr)); - if (mgr) - status = mgr->GetService(mCID, aIID, (void**)aInstancePtr); - } - if ( NS_FAILED(status) ) + nsresult status = CallGetService(mCID, aIID, aInstancePtr); + if ( NS_FAILED(status) ) { + error: *aInstancePtr = 0; - + } + + return status; +} + +nsresult +nsGetServiceByCIDWithError::operator()( const nsIID& aIID, void** aInstancePtr ) const +{ + nsresult status = CallGetService(mCID, aIID, aInstancePtr); + if ( NS_FAILED(status) ) { + error: + *aInstancePtr = 0; + } + if ( mErrorPtr ) *mErrorPtr = status; return status; @@ -225,20 +277,23 @@ nsGetServiceByCID::operator()( const nsIID& aIID, void** aInstancePtr ) const nsresult nsGetServiceByContractID::operator()( const nsIID& aIID, void** aInstancePtr ) const { - nsresult status = NS_ERROR_FAILURE; - nsCOMPtr serviceManager = - do_QueryInterface(mServiceManager); - if ( serviceManager ) { - status = serviceManager->GetServiceByContractID(mContractID, aIID, (void**)aInstancePtr); - } else { - nsCOMPtr mgr; - NS_GetServiceManager(getter_AddRefs(mgr)); - if (mgr) - status = mgr->GetServiceByContractID(mContractID, aIID, (void**)aInstancePtr); + nsresult status = CallGetService(mContractID, aIID, aInstancePtr); + if ( NS_FAILED(status) ) { + error: + *aInstancePtr = 0; } - if ( NS_FAILED(status) ) + return status; +} + +nsresult +nsGetServiceByContractIDWithError::operator()( const nsIID& aIID, void** aInstancePtr ) const +{ + nsresult status = CallGetService(mContractID, aIID, aInstancePtr); + if ( NS_FAILED(status) ) { + error: *aInstancePtr = 0; + } if ( mErrorPtr ) *mErrorPtr = status; diff --git a/mozilla/xpcom/glue/nsServiceManagerUtils.h b/mozilla/xpcom/glue/nsServiceManagerUtils.h index 5e3ac6885b0..0a61f611730 100644 --- a/mozilla/xpcom/glue/nsServiceManagerUtils.h +++ b/mozilla/xpcom/glue/nsServiceManagerUtils.h @@ -35,90 +35,48 @@ * * ***** END LICENSE BLOCK ***** */ -#ifndef nsIServiceManagerUtils_h__ -#define nsIServiceManagerUtils_h__ +#ifndef nsServiceManagerUtils_h__ +#define nsServiceManagerUtils_h__ #include "nsIServiceManager.h" #include "nsIServiceManagerObsolete.h" #include "nsCOMPtr.h" -//////////////////////////////////////////////////////////////////////////// -// Using servicemanager with COMPtrs -class NS_COM nsGetServiceByCID : public nsCOMPtr_helper -{ - public: - nsGetServiceByCID( const nsCID& aCID, nsISupports* aServiceManager, nsresult* aErrorPtr ) - : mCID(aCID), - mServiceManager(aServiceManager), - mErrorPtr(aErrorPtr) - { - // nothing else to do - } - - virtual nsresult NS_FASTCALL operator()( const nsIID&, void** ) const; - - private: - const nsCID& mCID; - nsISupports* mServiceManager; - nsresult* mErrorPtr; -}; - inline const nsGetServiceByCID -do_GetService( const nsCID& aCID, nsresult* error = 0 ) +do_GetService(const nsCID& aCID) { - return nsGetServiceByCID(aCID, 0, error); + return nsGetServiceByCID(aCID); } inline -const nsGetServiceByCID -do_GetService( const nsCID& aCID, nsISupports* aServiceManager, nsresult* error = 0 ) +const nsGetServiceByCIDWithError +do_GetService(const nsCID& aCID, nsresult* error) { - return nsGetServiceByCID(aCID, aServiceManager, error); -} - -class NS_COM nsGetServiceByContractID : public nsCOMPtr_helper -{ - public: - nsGetServiceByContractID( const char* aContractID, nsISupports* aServiceManager, nsresult* aErrorPtr ) - : mContractID(aContractID), - mServiceManager(aServiceManager), - mErrorPtr(aErrorPtr) - { - // nothing else to do - } - - virtual nsresult NS_FASTCALL operator()( const nsIID&, void** ) const; - - private: - const char* mContractID; - nsISupports* mServiceManager; - nsresult* mErrorPtr; -}; - -inline -const nsGetServiceByContractID -do_GetService( const char* aContractID, nsresult* error = 0 ) -{ - return nsGetServiceByContractID(aContractID, 0, error); + return nsGetServiceByCIDWithError(aCID, error); } inline const nsGetServiceByContractID -do_GetService( const char* aContractID, nsISupports* aServiceManager, nsresult* error = 0 ) +do_GetService(const char* aContractID) { - return nsGetServiceByContractID(aContractID, aServiceManager, error); + return nsGetServiceByContractID(aContractID); +} + +inline +const nsGetServiceByContractIDWithError +do_GetService( const char* aContractID, nsresult* error) +{ + return nsGetServiceByContractIDWithError(aContractID, error); } class nsGetServiceFromCategory : public nsCOMPtr_helper { public: nsGetServiceFromCategory(const char* aCategory, const char* aEntry, - nsISupports* aServiceManager, nsresult* aErrorPtr) : mCategory(aCategory), mEntry(aEntry), - mServiceManager(aServiceManager), mErrorPtr(aErrorPtr) { // nothing else to do @@ -128,7 +86,6 @@ class nsGetServiceFromCategory : public nsCOMPtr_helper protected: const char* mCategory; const char* mEntry; - nsISupports* mServiceManager; nsresult* mErrorPtr; }; @@ -137,9 +94,15 @@ const nsGetServiceFromCategory do_GetServiceFromCategory( const char* category, const char* entry, nsresult* error = 0) { - return nsGetServiceFromCategory(category, entry, 0, error); + return nsGetServiceFromCategory(category, entry, error); } +NS_COM_GLUE nsresult +CallGetService(const nsCID &aClass, const nsIID &aIID, void **aResult); + +NS_COM_GLUE nsresult +CallGetService(const char *aContractID, const nsIID &aIID, void **aResult); + // type-safe shortcuts for calling |GetService| template inline @@ -149,15 +112,9 @@ CallGetService( const nsCID &aClass, { NS_PRECONDITION(aDestination, "null parameter"); - nsCOMPtr mgr; - nsresult rv = NS_GetServiceManager(getter_AddRefs(mgr)); - - if (NS_FAILED(rv)) - return rv; - - return mgr->GetService(aClass, - NS_GET_IID(DestinationType), - NS_REINTERPRET_CAST(void**, aDestination)); + return CallGetService(aClass, + NS_GET_IID(DestinationType), + NS_REINTERPRET_CAST(void**, aDestination)); } template @@ -169,15 +126,9 @@ CallGetService( const char *aContractID, NS_PRECONDITION(aContractID, "null parameter"); NS_PRECONDITION(aDestination, "null parameter"); - nsCOMPtr mgr; - nsresult rv = NS_GetServiceManager(getter_AddRefs(mgr)); - - if (NS_FAILED(rv)) - return rv; - - return mgr->GetServiceByContractID(aContractID, - NS_GET_IID(DestinationType), - NS_REINTERPRET_CAST(void**, aDestination)); + return CallGetService(aContractID, + NS_GET_IID(DestinationType), + NS_REINTERPRET_CAST(void**, aDestination)); } #endif diff --git a/mozilla/xpcom/glue/objs.mk b/mozilla/xpcom/glue/objs.mk index 98ab1c6f798..88d9e34d844 100644 --- a/mozilla/xpcom/glue/objs.mk +++ b/mozilla/xpcom/glue/objs.mk @@ -54,6 +54,7 @@ XPCOM_GLUE_SRC_LEXPORTS = \ nsTraceRefcnt.h \ nsWeakReference.h \ nsComponentManagerUtils.h \ + nsServiceManagerUtils.h \ $(NULL) diff --git a/mozilla/xpcom/io/nsIFastLoadService.idl b/mozilla/xpcom/io/nsIFastLoadService.idl index 0b177463991..e27050b6d98 100644 --- a/mozilla/xpcom/io/nsIFastLoadService.idl +++ b/mozilla/xpcom/io/nsIFastLoadService.idl @@ -133,11 +133,11 @@ interface nsIFastLoadService : nsISupports # include "nsIServiceManager.h" #endif -inline const nsGetServiceByCID +inline const nsGetServiceByCIDWithError do_GetFastLoadService(nsresult *aResultCode = 0) { static NS_DEFINE_CID(kFastLoadServiceCID, NS_FASTLOADSERVICE_CID); - return nsGetServiceByCID(kFastLoadServiceCID, nsnull, aResultCode); + return nsGetServiceByCIDWithError(kFastLoadServiceCID, aResultCode); } inline nsresult diff --git a/mozilla/xpcom/stub/nsOS2VACLegacy.cpp b/mozilla/xpcom/stub/nsOS2VACLegacy.cpp index 4de75d46c9b..164ea3acc10 100644 --- a/mozilla/xpcom/stub/nsOS2VACLegacy.cpp +++ b/mozilla/xpcom/stub/nsOS2VACLegacy.cpp @@ -67,7 +67,7 @@ * Header Files * *******************************************************************************/ #include "nscore.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" /******************************************************************************* diff --git a/mozilla/xpcom/tools/registry/Makefile.in b/mozilla/xpcom/tools/registry/Makefile.in index a81de30ac25..251355e933e 100644 --- a/mozilla/xpcom/tools/registry/Makefile.in +++ b/mozilla/xpcom/tools/registry/Makefile.in @@ -59,6 +59,7 @@ SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=$(BIN_SUFFIX)) LIBS = \ $(DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX) \ + $(XPCOM_LIBS) \ $(NSPR_LIBS) \ $(NULL) diff --git a/mozilla/xpfe/bootstrap/nsAppRunner.cpp b/mozilla/xpfe/bootstrap/nsAppRunner.cpp index a46824e9b09..b23e4be2e87 100644 --- a/mozilla/xpfe/bootstrap/nsAppRunner.cpp +++ b/mozilla/xpfe/bootstrap/nsAppRunner.cpp @@ -46,7 +46,7 @@ #include "nsXPCOM.h" #include "nsIServiceManager.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsIComponentManager.h" #include "nsComponentManagerUtils.h" #include "nsIGenericFactory.h" diff --git a/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp b/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp index fda437fdc3b..aa66fa2f063 100644 --- a/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp +++ b/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp @@ -51,7 +51,7 @@ #include "nsIComponentManager.h" #include "nsComponentManagerUtils.h" #include "nsIServiceManager.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsICmdLineHandler.h" #include "nsIDOMWindow.h" #include "nsXPCOM.h" diff --git a/mozilla/xpfe/bootstrap/nsNativeAppSupportWin.cpp b/mozilla/xpfe/bootstrap/nsNativeAppSupportWin.cpp index 0661bc281fd..45f45d8568c 100644 --- a/mozilla/xpfe/bootstrap/nsNativeAppSupportWin.cpp +++ b/mozilla/xpfe/bootstrap/nsNativeAppSupportWin.cpp @@ -46,7 +46,7 @@ #include "nsIComponentManager.h" #include "nsComponentManagerUtils.h" #include "nsIServiceManager.h" -#include "nsIServiceManagerUtils.h" +#include "nsServiceManagerUtils.h" #include "nsICmdLineHandler.h" #include "nsIDOMWindow.h" #include "nsXPCOM.h"