diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index e41b989f6c3..81830b94cef 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -134,10 +134,7 @@ // CIDs // -static NS_DEFINE_CID(kLocalStoreCID, NS_LOCALSTORE_CID); static NS_DEFINE_CID(kParserCID, NS_PARSER_CID); -static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); -static NS_DEFINE_CID(kXULPrototypeCacheCID, NS_XULPROTOTYPECACHE_CID); static PRBool IsChromeURI(nsIURI* aURI) { @@ -1850,12 +1847,12 @@ nsXULDocument::Init() // this _could_ fail; e.g., if we've tried to grab the local store // before profiles have initialized. If so, no big deal; nothing // will persist. - mLocalStore = do_GetService(kLocalStoreCID); + mLocalStore = do_GetService(NS_LOCALSTORE_CONTRACTID); if (gRefCnt++ == 0) { // Keep the RDF service cached in a member variable to make using // it a bit less painful - rv = CallGetService(kRDFServiceCID, &gRDFService); + rv = CallGetService("@mozilla.org/rdf/rdf-service;1", &gRDFService); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF Service"); if (NS_FAILED(rv)) return rv; diff --git a/embedding/browser/gtk/src/EmbedCertificates.cpp b/embedding/browser/gtk/src/EmbedCertificates.cpp index 355ff580cb6..62a332955f9 100644 --- a/embedding/browser/gtk/src/EmbedCertificates.cpp +++ b/embedding/browser/gtk/src/EmbedCertificates.cpp @@ -75,8 +75,6 @@ #define PIPSTRING_BUNDLE_URL "chrome://pippki/locale/pippki.properties" -static NS_DEFINE_CID(kCStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); - EmbedCertificates::EmbedCertificates(void) { } @@ -105,7 +103,8 @@ nsresult EmbedCertificates::Init(void) { nsresult rv; - nsCOMPtr service = do_GetService(kCStringBundleServiceCID, &rv); + nsCOMPtr service = + do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv); if (NS_FAILED(rv)) return NS_OK; rv = service->CreateBundle(PIPSTRING_BUNDLE_URL, getter_AddRefs(mPIPStringBundle)); diff --git a/embedding/minimo/chromelite/nsSimpleChromeHandler.cpp b/embedding/minimo/chromelite/nsSimpleChromeHandler.cpp index f5a19471ee8..3c2b85855a7 100644 --- a/embedding/minimo/chromelite/nsSimpleChromeHandler.cpp +++ b/embedding/minimo/chromelite/nsSimpleChromeHandler.cpp @@ -88,8 +88,7 @@ nsSimpleChromeURL::Init(PRUint32 urlType, { nsresult rv; - static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID); - mStandardURL = do_CreateInstance(kStandardURLCID, &rv); + mStandardURL = do_CreateInstance(NS_STANDARDURL_CONTRACTID, &rv); NS_ASSERTION(mStandardURL, "Could not create a Standard URL"); if (NS_FAILED(rv)) return rv; @@ -171,8 +170,6 @@ nsSimpleChromeHandler::GetProtocolFlags(PRUint32 *result) return NS_OK; } -static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID); - NS_IMETHODIMP nsSimpleChromeHandler::NewURI(const nsACString &aSpec, const char *aCharset, diff --git a/intl/uconv/src/nsCharsetConverterManager.cpp b/intl/uconv/src/nsCharsetConverterManager.cpp index 6550bf0011c..5fd364e4a89 100644 --- a/intl/uconv/src/nsCharsetConverterManager.cpp +++ b/intl/uconv/src/nsCharsetConverterManager.cpp @@ -56,16 +56,13 @@ #include "nsXPCOM.h" #include "nsISupportsPrimitives.h" -// just for CIDs +// just for CONTRACTIDs #include "nsCharsetConverterManager.h" #ifdef MOZ_USE_NATIVE_UCONV #include "nsNativeUConvService.h" #endif -static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); -static NS_DEFINE_CID(kCharsetAliasCID, NS_CHARSETALIAS_CID); - // Pattern of cached, commonly used, single byte decoder #define NS_1BYTE_CODER_PATTERN "ISO-8859" #define NS_1BYTE_CODER_PATTERN_LEN 8 @@ -121,7 +118,7 @@ nsresult nsCharsetConverterManager::LoadExtensibleBundle( nsresult rv = NS_OK; nsCOMPtr sbServ = - do_GetService(kStringBundleServiceCID, &rv); + do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv); if (NS_FAILED(rv)) return rv; @@ -372,7 +369,7 @@ nsCharsetConverterManager::GetCharsetAlias(const char * aCharset, // We try to obtain the preferred name for this charset from the charset // aliases. If we don't get it from there, we just use the original string nsDependentCString charset(aCharset); - nsCOMPtr csAlias( do_GetService(kCharsetAliasCID) ); + nsCOMPtr csAlias(do_GetService(NS_CHARSETALIAS_CONTRACTID)); NS_ASSERTION(csAlias, "failed to get the CharsetAlias service"); if (csAlias) { nsAutoString pref; diff --git a/intl/uconv/tests/convperf.cpp b/intl/uconv/tests/convperf.cpp index d7de19a840b..3737e23dbcb 100644 --- a/intl/uconv/tests/convperf.cpp +++ b/intl/uconv/tests/convperf.cpp @@ -43,8 +43,6 @@ #include "nsICharsetConverterManager.h" #include "nsIUnicodeEncoder.h" #include "nsIUnicodeDecoder.h" -static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID); -static NS_DEFINE_IID(kICharsetConverterManagerIID, NS_ICHARSETCONVERTERMANAGER_IID); #include #include @@ -114,7 +112,7 @@ int main(int argc, const char** argv) { nsresult res; nsCOMPtr ccMain = - do_GetService(kCharsetConverterManagerCID, &res); + do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &res); if(NS_FAILED(res)) { fprintf(stderr, "Cannot get Character Converter Manager %x\n", res); diff --git a/intl/uconv/tests/plattest.cpp b/intl/uconv/tests/plattest.cpp index d549485c9af..866ae819dc6 100644 --- a/intl/uconv/tests/plattest.cpp +++ b/intl/uconv/tests/plattest.cpp @@ -42,10 +42,6 @@ #include "nsIComponentManager.h" #include -NS_DEFINE_IID(kLocaleServiceIID,NS_ILOCALESERVICE_IID); -NS_DEFINE_CID(kLocaleServiceCID,NS_LOCALESERVICE_CID); -NS_DEFINE_IID(kPlatformCharsetIID,NS_IPLATFORMCHARSET_IID); - int main(int argc, const char** argv) { @@ -55,7 +51,7 @@ main(int argc, const char** argv) if (!platform_charset) return -1; nsCOMPtr locale_service = - do_CreateInstance(kLocaleServiceCID); + do_CreateInstance(NS_LOCALESERVICE_CONTRACTID); if (!locale_service) return -1; nsCOMPtr locale; diff --git a/modules/oji/src/jvmmgr.cpp b/modules/oji/src/jvmmgr.cpp index 930e41e78a5..f9934784ae9 100644 --- a/modules/oji/src/jvmmgr.cpp +++ b/modules/oji/src/jvmmgr.cpp @@ -44,7 +44,7 @@ #include "nsCSecurityContext.h" #include "nsIJSContextStack.h" -static NS_DEFINE_CID(kJVMManagerCID, NS_JVMMANAGER_CID); +#define NS_JVMMANAGER_CONTRACTID "@mozilla.org/oji/jvm-mgr;1" static NS_DEFINE_IID(kIJVMConsoleIID, NS_IJVMCONSOLE_IID); static NS_DEFINE_IID(kIJVMPrefsWindowIID, NS_IJVMPREFSWINDOW_IID); static NS_DEFINE_IID(kISymantecDebuggerIID, NS_ISYMANTECDEBUGGER_IID); @@ -66,7 +66,7 @@ GetRunningJVM(void) { nsIJVMPlugin* jvm = NULL; nsresult rv; - nsCOMPtr managerService = do_GetService(kJVMManagerCID, &rv); + nsCOMPtr managerService = do_GetService(NS_JVMMANAGER_CONTRACTID, &rv); if (NS_FAILED(rv)) return jvm; nsJVMManager* jvmMgr = (nsJVMManager *)managerService.get(); if (jvmMgr) { @@ -92,7 +92,7 @@ JVM_ShutdownJVM(void) { nsJVMStatus status = nsJVMStatus_Failed; nsresult rv; - nsCOMPtr managerService = do_GetService(kJVMManagerCID, &rv); + nsCOMPtr managerService = do_GetService(NS_JVMMANAGER_CONTRACTID, &rv); if (NS_FAILED(rv)) return status; nsJVMManager* mgr = (nsJVMManager *)managerService.get(); if (mgr) { @@ -107,7 +107,7 @@ JVM_GetJVMStatus(void) { nsresult rv; nsJVMStatus status = nsJVMStatus_Disabled; - nsCOMPtr managerService = do_GetService(kJVMManagerCID, &rv); + nsCOMPtr managerService = do_GetService(NS_JVMMANAGER_CONTRACTID, &rv); if (NS_FAILED(rv)) return status; nsJVMManager* mgr = (nsJVMManager *)managerService.get(); if (mgr) { @@ -120,7 +120,7 @@ PR_IMPLEMENT(PRBool) JVM_AddToClassPath(const char* dirPath) { nsresult err = NS_ERROR_FAILURE; - nsCOMPtr managerService = do_GetService(kJVMManagerCID, &err); + nsCOMPtr managerService = do_GetService(NS_JVMMANAGER_CONTRACTID, &err); if (NS_FAILED(err)) return PR_FALSE; nsJVMManager* mgr = (nsJVMManager *)managerService.get(); if (mgr) { @@ -322,7 +322,7 @@ JVM_MaybeStartupLiveConnect() { PRBool result = PR_FALSE; nsresult rv; - nsCOMPtr managerService = do_GetService(kJVMManagerCID, &rv); + nsCOMPtr managerService = do_GetService(NS_JVMMANAGER_CONTRACTID, &rv); if (NS_FAILED(rv)) return result; nsJVMManager* mgr = (nsJVMManager *)managerService.get(); if (mgr) { @@ -337,7 +337,7 @@ JVM_MaybeShutdownLiveConnect(void) { PRBool result = PR_FALSE; nsresult rv; - nsCOMPtr managerService = do_GetService(kJVMManagerCID, &rv); + nsCOMPtr managerService = do_GetService(NS_JVMMANAGER_CONTRACTID, &rv); if (NS_FAILED(rv)) return result; nsJVMManager* mgr = (nsJVMManager *)managerService.get(); if (mgr) { @@ -351,7 +351,7 @@ JVM_IsLiveConnectEnabled(void) { PRBool result = PR_FALSE; nsresult rv; - nsCOMPtr managerService = do_GetService(kJVMManagerCID, &rv); + nsCOMPtr managerService = do_GetService(NS_JVMMANAGER_CONTRACTID, &rv); if (NS_FAILED(rv)) return result; nsJVMManager* mgr = (nsJVMManager *)managerService.get(); if (mgr) { diff --git a/modules/plugin/base/src/nsPluginHostImpl.cpp b/modules/plugin/base/src/nsPluginHostImpl.cpp index 3127690af49..f131a2ac164 100644 --- a/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -211,7 +211,6 @@ static NS_DEFINE_IID(kIPluginTagInfo2IID, NS_IPLUGINTAGINFO2_IID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static const char kDirectoryServiceContractID[] = "@mozilla.org/file/directory_service;1"; // for the dialog -static NS_DEFINE_IID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); static NS_DEFINE_CID(kCPluginManagerCID, NS_PLUGINMANAGER_CID); // needed for NS_TRY_SAFE_CALL //////////////////////////////////////////////////////////////////////// @@ -6482,7 +6481,7 @@ nsPluginHostImpl::HandleBadPlugin(PRLibrary* aLibrary, nsIPluginInstance *aInsta nsCOMPtr prompt; GetPrompt(owner, getter_AddRefs(prompt)); if (prompt) { - nsCOMPtr strings(do_GetService(kStringBundleServiceCID, &rv)); + nsCOMPtr strings(do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv)); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/base/src/nsIOService.cpp b/netwerk/base/src/nsIOService.cpp index 5b791b302e8..a82209abc1b 100644 --- a/netwerk/base/src/nsIOService.cpp +++ b/netwerk/base/src/nsIOService.cpp @@ -81,12 +81,6 @@ #define MAX_RECURSION_COUNT 50 -static NS_DEFINE_CID(kStreamTransportServiceCID, NS_STREAMTRANSPORTSERVICE_CID); -static NS_DEFINE_CID(kSocketTransportServiceCID, NS_SOCKETTRANSPORTSERVICE_CID); -static NS_DEFINE_CID(kDNSServiceCID, NS_DNSSERVICE_CID); -static NS_DEFINE_CID(kErrorServiceCID, NS_ERRORSERVICE_CID); -static NS_DEFINE_CID(kProtocolProxyServiceCID, NS_PROTOCOLPROXYSERVICE_CID); - nsIOService* gIOService = nsnull; // A general port blacklist. Connections to these ports will not be allowed unless @@ -202,20 +196,20 @@ nsIOService::Init() // TODO(darin): Load the Socket and DNS services lazily. - mSocketTransportService = do_GetService(kSocketTransportServiceCID, &rv); + mSocketTransportService = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv); if (NS_FAILED(rv)) { NS_WARNING("failed to get socket transport service"); return rv; } - mDNSService = do_GetService(kDNSServiceCID, &rv); + mDNSService = do_GetService(NS_DNSSERVICE_CONTRACTID, &rv); if (NS_FAILED(rv)) { NS_WARNING("failed to get DNS service"); return rv; } // XXX hack until xpidl supports error info directly (bug 13423) - nsCOMPtr errorService = do_GetService(kErrorServiceCID); + nsCOMPtr errorService = do_GetService(NS_ERRORSERVICE_CONTRACTID); if (errorService) { errorService->RegisterErrorStringBundle(NS_ERROR_MODULE_NETWORK, NECKO_MSGS_URL); } diff --git a/netwerk/protocol/ftp/src/nsFtpProtocolHandler.cpp b/netwerk/protocol/ftp/src/nsFtpProtocolHandler.cpp index a125361631a..585927e5a5f 100644 --- a/netwerk/protocol/ftp/src/nsFtpProtocolHandler.cpp +++ b/netwerk/protocol/ftp/src/nsFtpProtocolHandler.cpp @@ -88,9 +88,6 @@ PRLogModuleInfo* gFTPLog = nsnull; #define IDLE_TIMEOUT_PREF "network.ftp.idleConnectionTimeout" #define IDLE_CONNECTION_LIMIT 8 /* TODO pref me */ -static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID); -static NS_DEFINE_CID(kCacheServiceCID, NS_CACHESERVICE_CID); - nsFtpProtocolHandler *gFtpHandler = nsnull; //----------------------------------------------------------------------------- @@ -197,7 +194,7 @@ nsFtpProtocolHandler::NewURI(const nsACString &aSpec, return NS_ERROR_MALFORMED_URI; nsresult rv; - nsCOMPtr url = do_CreateInstance(kStandardURLCID, &rv); + nsCOMPtr url = do_CreateInstance(NS_STANDARDURL_CONTRACTID, &rv); if (NS_FAILED(rv)) return rv; rv = url->Init(nsIStandardURL::URLTYPE_AUTHORITY, 21, aSpec, aCharset, aBaseURI); diff --git a/security/manager/boot/src/nsSecurityWarningDialogs.cpp b/security/manager/boot/src/nsSecurityWarningDialogs.cpp index 254b16c2cf3..ffa7f8fde07 100644 --- a/security/manager/boot/src/nsSecurityWarningDialogs.cpp +++ b/security/manager/boot/src/nsSecurityWarningDialogs.cpp @@ -51,8 +51,6 @@ NS_IMPL_THREADSAFE_ISUPPORTS1(nsSecurityWarningDialogs, nsISecurityWarningDialogs) -static NS_DEFINE_CID(kCStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); - #define STRING_BUNDLE_URL "chrome://pipnss/locale/security.properties" #define ENTER_SITE_PREF "security.warn_entering_secure" @@ -77,7 +75,8 @@ nsSecurityWarningDialogs::Init() mPrefBranch = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv); if (NS_FAILED(rv)) return rv; - nsCOMPtr service = do_GetService(kCStringBundleServiceCID, &rv); + nsCOMPtr service = + do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv); if (NS_FAILED(rv)) return rv; rv = service->CreateBundle(STRING_BUNDLE_URL, diff --git a/security/manager/pki/src/nsNSSDialogs.cpp b/security/manager/pki/src/nsNSSDialogs.cpp index 3179fd0636f..b5f67102cc2 100644 --- a/security/manager/pki/src/nsNSSDialogs.cpp +++ b/security/manager/pki/src/nsNSSDialogs.cpp @@ -68,10 +68,7 @@ #define PIPSTRING_BUNDLE_URL "chrome://pippki/locale/pippki.properties" -static NS_DEFINE_CID(kCStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); - /* ==== */ -static NS_DEFINE_CID(kPKIParamBlockCID, NS_PKIPARAMBLOCK_CID); nsNSSDialogs::nsNSSDialogs() { @@ -95,7 +92,8 @@ nsNSSDialogs::Init() { nsresult rv; - nsCOMPtr service = do_GetService(kCStringBundleServiceCID, &rv); + nsCOMPtr service = + do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv); if (NS_FAILED(rv)) return rv; rv = service->CreateBundle(PIPSTRING_BUNDLE_URL, @@ -114,7 +112,8 @@ nsNSSDialogs::SetPassword(nsIInterfaceRequestor *ctx, // Get the parent window for the dialog nsCOMPtr parent = do_GetInterface(ctx); - nsCOMPtr block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID)); + nsCOMPtr block = + do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID); if (!block) return NS_ERROR_FAILURE; // void ChangePassword(in wstring tokenName, out int status); @@ -147,7 +146,8 @@ nsNSSDialogs::GetPassword(nsIInterfaceRequestor *ctx, *_canceled = PR_FALSE; // Get the parent window for the dialog nsCOMPtr parent = do_GetInterface(ctx); - nsCOMPtr block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID)); + nsCOMPtr block = + do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID); if (!block) return NS_ERROR_FAILURE; // Set the token name in the window rv = block->SetString(1, tokenName); @@ -179,7 +179,8 @@ nsNSSDialogs::ConfirmUnknownIssuer(nsIInterfaceRequestor *socketInfo, *_retval = PR_FALSE; - nsCOMPtr block = do_CreateInstance(kPKIParamBlockCID); + nsCOMPtr block = + do_CreateInstance(NS_PKIPARAMBLOCK_CONTRACTID); if (!block) return NS_ERROR_FAILURE; @@ -236,7 +237,8 @@ nsNSSDialogs::ConfirmMismatchDomain(nsIInterfaceRequestor *socketInfo, *_retval = PR_FALSE; - nsCOMPtr block = do_CreateInstance(kPKIParamBlockCID); + nsCOMPtr block = + do_CreateInstance(NS_PKIPARAMBLOCK_CONTRACTID); if (!block) return NS_ERROR_FAILURE; @@ -280,7 +282,8 @@ nsNSSDialogs::ConfirmCertExpired(nsIInterfaceRequestor *socketInfo, *_retval = PR_FALSE; - nsCOMPtr block = do_CreateInstance(kPKIParamBlockCID); + nsCOMPtr block = + do_CreateInstance(NS_PKIPARAMBLOCK_CONTRACTID); if (!block) return NS_ERROR_FAILURE; @@ -358,7 +361,8 @@ nsNSSDialogs::NotifyCrlNextupdate(nsIInterfaceRequestor *socketInfo, { nsresult rv; - nsCOMPtr block = do_CreateInstance(kPKIParamBlockCID); + nsCOMPtr block = + do_CreateInstance(NS_PKIPARAMBLOCK_CONTRACTID); nsCOMPtr dialogBlock = do_QueryInterface(block); rv = dialogBlock->SetString(1, NS_ConvertUTF8toUTF16(targetURL).get()); @@ -380,7 +384,8 @@ nsNSSDialogs::CrlImportStatusDialog(nsIInterfaceRequestor *ctx, nsICRLInfo *crl) { nsresult rv; - nsCOMPtr block = do_CreateInstance(kPKIParamBlockCID,&rv); + nsCOMPtr block = + do_CreateInstance(NS_PKIPARAMBLOCK_CONTRACTID,&rv); if (NS_FAILED(rv)) return rv; @@ -407,7 +412,8 @@ nsNSSDialogs::ConfirmDownloadCACert(nsIInterfaceRequestor *ctx, // Get the parent window for the dialog nsCOMPtr parent = do_GetInterface(ctx); - nsCOMPtr block = do_CreateInstance(kPKIParamBlockCID); + nsCOMPtr block = + do_CreateInstance(NS_PKIPARAMBLOCK_CONTRACTID); if (!block) return NS_ERROR_FAILURE; @@ -453,7 +459,8 @@ nsNSSDialogs::NotifyCACertExists(nsIInterfaceRequestor *ctx) // Get the parent window for the dialog nsCOMPtr parent = do_GetInterface(ctx); - nsCOMPtr block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID)); + nsCOMPtr block = + do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID); if (!block) return NS_ERROR_FAILURE; @@ -476,7 +483,8 @@ nsNSSDialogs::ChooseCertificate(nsIInterfaceRequestor *ctx, const PRUnichar *cn, // Get the parent window for the dialog nsCOMPtr parent = do_GetInterface(ctx); - nsCOMPtr block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID)); + nsCOMPtr block = + do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID); if (!block) return NS_ERROR_FAILURE; block->SetNumberStrings(4+count*2); @@ -538,7 +546,8 @@ nsNSSDialogs::PickCertificate(nsIInterfaceRequestor *ctx, // Get the parent window for the dialog nsCOMPtr parent = do_GetInterface(ctx); - nsCOMPtr block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID)); + nsCOMPtr block = + do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID); if (!block) return NS_ERROR_FAILURE; block->SetNumberStrings(1+count*2); @@ -586,7 +595,8 @@ nsNSSDialogs::SetPKCS12FilePassword(nsIInterfaceRequestor *ctx, *_retval = PR_TRUE; // Get the parent window for the dialog nsCOMPtr parent = do_GetInterface(ctx); - nsCOMPtr block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID)); + nsCOMPtr block = + do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID); if (!block) return NS_ERROR_FAILURE; // open up the window rv = nsNSSDialogHelper::openDialog(parent, @@ -619,7 +629,8 @@ nsNSSDialogs::GetPKCS12FilePassword(nsIInterfaceRequestor *ctx, *_retval = PR_TRUE; // Get the parent window for the dialog nsCOMPtr parent = do_GetInterface(ctx); - nsCOMPtr block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID)); + nsCOMPtr block = + do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID); if (!block) return NS_ERROR_FAILURE; // open up the window rv = nsNSSDialogHelper::openDialog(parent, @@ -650,7 +661,8 @@ nsNSSDialogs::ViewCert(nsIInterfaceRequestor *ctx, { nsresult rv; - nsCOMPtr block = do_CreateInstance(kPKIParamBlockCID); + nsCOMPtr block = + do_CreateInstance(NS_PKIPARAMBLOCK_CONTRACTID); if (!block) return NS_ERROR_FAILURE; @@ -691,7 +703,8 @@ nsNSSDialogs::ChooseToken(nsIInterfaceRequestor *aCtx, const PRUnichar **aTokenL // Get the parent window for the dialog nsCOMPtr parent = do_GetInterface(aCtx); - nsCOMPtr block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID)); + nsCOMPtr block = + do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID); if (!block) return NS_ERROR_FAILURE; block->SetNumberStrings(aCount); @@ -731,7 +744,8 @@ nsNSSDialogs::ConfirmKeyEscrow(nsIX509Cert *escrowAuthority, PRBool *_retval) nsresult rv; - nsCOMPtr block = do_CreateInstance(kPKIParamBlockCID); + nsCOMPtr block = + do_CreateInstance(NS_PKIPARAMBLOCK_CONTRACTID); if (!block) return NS_ERROR_FAILURE; diff --git a/security/manager/ssl/src/nsNSSIOLayer.cpp b/security/manager/ssl/src/nsNSSIOLayer.cpp index 12cbb40b097..747942ebaa3 100644 --- a/security/manager/ssl/src/nsNSSIOLayer.cpp +++ b/security/manager/ssl/src/nsNSSIOLayer.cpp @@ -690,9 +690,8 @@ nsHandleSSLError(nsNSSSocketInfo *socketInfo, PRInt32 err) socketInfo->GetHostName(getter_Copies(hostName)); NS_ConvertASCIItoUTF16 hostNameU(hostName); - NS_DEFINE_CID(StringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); nsCOMPtr service = - do_GetService(StringBundleServiceCID, &rv); + do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv); nsString formattedString; rv = getErrorMessage(err, hostNameU, nssComponent, formattedString); diff --git a/uriloader/exthandler/os2/nsMIMEInfoOS2.cpp b/uriloader/exthandler/os2/nsMIMEInfoOS2.cpp index e5e9521bb64..56ac0374e1e 100755 --- a/uriloader/exthandler/os2/nsMIMEInfoOS2.cpp +++ b/uriloader/exthandler/os2/nsMIMEInfoOS2.cpp @@ -163,7 +163,7 @@ nsresult nsMIMEInfoOS2::LoadUriInternal(nsIURI * aURL) /* Convert SimpleURI to StandardURL */ nsresult rv; - nsCOMPtr uri = do_CreateInstance(kStandardURLCID, &rv); + nsCOMPtr uri = do_CreateInstance(NS_STANDARDURL_CONTRACTID, &rv); if (NS_FAILED(rv)) { return NS_ERROR_FAILURE; } diff --git a/uriloader/exthandler/os2/nsMIMEInfoOS2.h b/uriloader/exthandler/os2/nsMIMEInfoOS2.h index c7f500e69da..a7498f9b470 100755 --- a/uriloader/exthandler/os2/nsMIMEInfoOS2.h +++ b/uriloader/exthandler/os2/nsMIMEInfoOS2.h @@ -42,7 +42,6 @@ #include "nsIPref.h" // XX Need to convert Handler code to new pref stuff #include "nsNetCID.h" #include "nsEscape.h" -static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID); // XXX need to convert to contract id #define INCL_DOS #define INCL_DOSMISC diff --git a/widget/src/xpwidgets/nsPrintOptionsImpl.cpp b/widget/src/xpwidgets/nsPrintOptionsImpl.cpp index cf030fc9824..a38b9fbeb7c 100644 --- a/widget/src/xpwidgets/nsPrintOptionsImpl.cpp +++ b/widget/src/xpwidgets/nsPrintOptionsImpl.cpp @@ -61,12 +61,9 @@ #include "nsIStringEnumerator.h" #include "nsISupportsPrimitives.h" -#include "nsWidgetsCID.h" #include "stdlib.h" #include "nsAutoPtr.h" -static NS_DEFINE_IID(kCPrinterEnumerator, NS_PRINTER_ENUMERATOR_CID); - NS_IMPL_ISUPPORTS2(nsPrintOptions, nsIPrintOptions, nsIPrintSettingsService) // Pref Constants @@ -113,8 +110,7 @@ static const char kJustLeft[] = "left"; static const char kJustCenter[] = "center"; static const char kJustRight[] = "right"; -static NS_DEFINE_IID(kPrinterEnumeratorCID, NS_PRINTER_ENUMERATOR_CID); - +#define NS_PRINTER_ENUMERATOR_CONTRACTID "@mozilla.org/gfx/printerenumerator;1" nsPrintOptions::nsPrintOptions() { @@ -771,7 +767,7 @@ nsPrintOptions::DisplayJobProperties(const PRUnichar *aPrinter, nsresult rv; nsCOMPtr propDlg = - do_CreateInstance(kCPrinterEnumerator, &rv); + do_CreateInstance(NS_PRINTER_ENUMERATOR_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_ARG_POINTER(aPrintSettings); @@ -835,8 +831,8 @@ NS_IMETHODIMP nsPrintOptions::GetDefaultPrinterName(PRUnichar * *aDefaultPrinterName) { nsresult rv; - nsCOMPtr prtEnum = do_GetService(kPrinterEnumeratorCID, - &rv); + nsCOMPtr prtEnum = + do_GetService(NS_PRINTER_ENUMERATOR_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); // Look up the printer from the last print job @@ -889,8 +885,8 @@ nsPrintOptions::InitPrintSettingsFromPrinter(const PRUnichar *aPrinterName, return NS_OK; nsresult rv; - nsCOMPtr prtEnum = do_GetService(kPrinterEnumeratorCID, - &rv); + nsCOMPtr prtEnum = + do_GetService(NS_PRINTER_ENUMERATOR_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); rv = prtEnum->InitPrintSettingsFromPrinter(aPrinterName, aPrintSettings); diff --git a/xpfe/appshell/src/nsXULWindow.cpp b/xpfe/appshell/src/nsXULWindow.cpp index 383651080c3..b50206db9bf 100644 --- a/xpfe/appshell/src/nsXULWindow.cpp +++ b/xpfe/appshell/src/nsXULWindow.cpp @@ -72,7 +72,6 @@ #include "nsIInterfaceRequestor.h" #include "nsIInterfaceRequestorUtils.h" #include "nsIIOService.h" -#include "nsNetCID.h" #include "nsIJSContextStack.h" #include "nsIMarkupDocumentViewer.h" #include "nsIObserverService.h" @@ -108,9 +107,6 @@ #define HEIGHT_ATTRIBUTE NS_LITERAL_STRING("height") #define MODE_ATTRIBUTE NS_LITERAL_STRING("sizemode") #define ZLEVEL_ATTRIBUTE NS_LITERAL_STRING("zlevel") -// CIDs -static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID); -static NS_DEFINE_CID(kWindowMediatorCID, NS_WINDOWMEDIATOR_CID); //***************************************************************************** //*** nsXULWindow: Object Management @@ -212,7 +208,7 @@ NS_IMETHODIMP nsXULWindow::GetDocShell(nsIDocShell** aDocShell) NS_IMETHODIMP nsXULWindow::GetZLevel(PRUint32 *outLevel) { - nsCOMPtr mediator(do_GetService(kWindowMediatorCID)); + nsCOMPtr mediator(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID)); if (mediator) mediator->GetZLevel(this, outLevel); else @@ -222,7 +218,7 @@ NS_IMETHODIMP nsXULWindow::GetZLevel(PRUint32 *outLevel) NS_IMETHODIMP nsXULWindow::SetZLevel(PRUint32 aLevel) { - nsCOMPtr mediator(do_GetService(kWindowMediatorCID)); + nsCOMPtr mediator(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID)); if (!mediator) return NS_ERROR_FAILURE; @@ -765,7 +761,7 @@ NS_IMETHODIMP nsXULWindow::SetVisibility(PRBool aVisibility) shellAsWin->SetVisibility(aVisibility); mWindow->Show(aVisibility); - nsCOMPtr windowMediator(do_GetService(kWindowMediatorCID)); + nsCOMPtr windowMediator(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID)); if (windowMediator) windowMediator->UpdateWindowTimeStamp(static_cast(this)); @@ -859,7 +855,7 @@ NS_IMETHODIMP nsXULWindow::SetTitle(const PRUnichar* aTitle) NS_ENSURE_SUCCESS(mWindow->SetTitle(mTitle), NS_ERROR_FAILURE); // Tell the window mediator that a title has changed - nsCOMPtr windowMediator(do_GetService(kWindowMediatorCID)); + nsCOMPtr windowMediator(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID)); if(!windowMediator) return NS_OK; @@ -1503,7 +1499,7 @@ NS_IMETHODIMP nsXULWindow::SavePersistentAttributes() } if (persistString.Find("zlevel") >= 0) { PRUint32 zLevel; - nsCOMPtr mediator(do_GetService(kWindowMediatorCID)); + nsCOMPtr mediator(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID)); if (mediator) { mediator->GetZLevel(this, &zLevel); PR_snprintf(sizeBuf, sizeof(sizeBuf), "%lu", (unsigned long)zLevel); @@ -1849,7 +1845,7 @@ PRBool nsXULWindow::ConstrainToZLevel( return PR_FALSE; #endif - nsCOMPtr mediator(do_GetService(kWindowMediatorCID)); + nsCOMPtr mediator(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID)); if(!mediator) return PR_FALSE; @@ -1939,7 +1935,7 @@ void nsXULWindow::PlaceWindowLayersBehind(PRUint32 aLowLevel, // step through windows in z-order from top to bottommost window - nsCOMPtr mediator(do_GetService(kWindowMediatorCID)); + nsCOMPtr mediator(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID)); if(!mediator) return; diff --git a/xpinstall/src/nsXPInstallManager.cpp b/xpinstall/src/nsXPInstallManager.cpp index a70e90b2a8f..86744c664ba 100644 --- a/xpinstall/src/nsXPInstallManager.cpp +++ b/xpinstall/src/nsXPInstallManager.cpp @@ -92,8 +92,6 @@ #include "nsEmbedCID.h" -static NS_DEFINE_IID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); - #define PREF_XPINSTALL_ENABLED "xpinstall.enabled" #define PREF_XPINSTALL_CONFIRM_DLG "xpinstall.dialog.confirm" #define PREF_XPINSTALL_STATUS_DLG_SKIN "xpinstall.dialog.progress.skin" @@ -437,7 +435,7 @@ PRBool nsXPInstallManager::ConfirmChromeInstall(nsIDOMWindowInternal* aParentWin nsXPIDLString applyNowText; nsXPIDLString confirmText; nsCOMPtr bundleSvc = - do_GetService( kStringBundleServiceCID ); + do_GetService(NS_STRINGBUNDLE_CONTRACTID); if (!bundleSvc) return PR_FALSE;