Bug 394139: Replace a bunch of NS_DEFINE_CIDs with CONTRACTIDs. r=/sr=/a=bsmedberg

This commit is contained in:
jag@tty.nl 2007-09-05 06:04:54 -07:00
parent 7ce7e8401d
commit 9198e9c4b8
18 changed files with 75 additions and 100 deletions

View File

@ -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;

View File

@ -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<nsIStringBundleService> service = do_GetService(kCStringBundleServiceCID, &rv);
nsCOMPtr<nsIStringBundleService> service =
do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
if (NS_FAILED(rv)) return NS_OK;
rv = service->CreateBundle(PIPSTRING_BUNDLE_URL,
getter_AddRefs(mPIPStringBundle));

View File

@ -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,

View File

@ -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<nsIStringBundleService> 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<nsICharsetAlias> csAlias( do_GetService(kCharsetAliasCID) );
nsCOMPtr<nsICharsetAlias> csAlias(do_GetService(NS_CHARSETALIAS_CONTRACTID));
NS_ASSERTION(csAlias, "failed to get the CharsetAlias service");
if (csAlias) {
nsAutoString pref;

View File

@ -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 <stdio.h>
#include <string.h>
@ -114,7 +112,7 @@ int main(int argc, const char** argv)
{
nsresult res;
nsCOMPtr<nsICharsetConverterManager> 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);

View File

@ -42,10 +42,6 @@
#include "nsIComponentManager.h"
#include <stdio.h>
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<nsILocaleService> locale_service =
do_CreateInstance(kLocaleServiceCID);
do_CreateInstance(NS_LOCALESERVICE_CONTRACTID);
if (!locale_service) return -1;
nsCOMPtr<nsILocale> locale;

View File

@ -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<nsIJVMManager> managerService = do_GetService(kJVMManagerCID, &rv);
nsCOMPtr<nsIJVMManager> 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<nsIJVMManager> managerService = do_GetService(kJVMManagerCID, &rv);
nsCOMPtr<nsIJVMManager> 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<nsIJVMManager> managerService = do_GetService(kJVMManagerCID, &rv);
nsCOMPtr<nsIJVMManager> 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<nsIJVMManager> managerService = do_GetService(kJVMManagerCID, &err);
nsCOMPtr<nsIJVMManager> 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<nsIJVMManager> managerService = do_GetService(kJVMManagerCID, &rv);
nsCOMPtr<nsIJVMManager> 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<nsIJVMManager> managerService = do_GetService(kJVMManagerCID, &rv);
nsCOMPtr<nsIJVMManager> 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<nsIJVMManager> managerService = do_GetService(kJVMManagerCID, &rv);
nsCOMPtr<nsIJVMManager> managerService = do_GetService(NS_JVMMANAGER_CONTRACTID, &rv);
if (NS_FAILED(rv)) return result;
nsJVMManager* mgr = (nsJVMManager *)managerService.get();
if (mgr) {

View File

@ -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<nsIPrompt> prompt;
GetPrompt(owner, getter_AddRefs(prompt));
if (prompt) {
nsCOMPtr<nsIStringBundleService> strings(do_GetService(kStringBundleServiceCID, &rv));
nsCOMPtr<nsIStringBundleService> strings(do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv));
if (NS_FAILED(rv))
return rv;

View File

@ -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<nsIErrorService> errorService = do_GetService(kErrorServiceCID);
nsCOMPtr<nsIErrorService> errorService = do_GetService(NS_ERRORSERVICE_CONTRACTID);
if (errorService) {
errorService->RegisterErrorStringBundle(NS_ERROR_MODULE_NETWORK, NECKO_MSGS_URL);
}

View File

@ -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<nsIStandardURL> url = do_CreateInstance(kStandardURLCID, &rv);
nsCOMPtr<nsIStandardURL> url = do_CreateInstance(NS_STANDARDURL_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
rv = url->Init(nsIStandardURL::URLTYPE_AUTHORITY, 21, aSpec, aCharset, aBaseURI);

View File

@ -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<nsIStringBundleService> service = do_GetService(kCStringBundleServiceCID, &rv);
nsCOMPtr<nsIStringBundleService> service =
do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
rv = service->CreateBundle(STRING_BUNDLE_URL,

View File

@ -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<nsIStringBundleService> service = do_GetService(kCStringBundleServiceCID, &rv);
nsCOMPtr<nsIStringBundleService> 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<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
nsCOMPtr<nsIDialogParamBlock> 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<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
nsCOMPtr<nsIDialogParamBlock> 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<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
nsCOMPtr<nsIPKIParamBlock> block =
do_CreateInstance(NS_PKIPARAMBLOCK_CONTRACTID);
if (!block)
return NS_ERROR_FAILURE;
@ -236,7 +237,8 @@ nsNSSDialogs::ConfirmMismatchDomain(nsIInterfaceRequestor *socketInfo,
*_retval = PR_FALSE;
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
nsCOMPtr<nsIPKIParamBlock> block =
do_CreateInstance(NS_PKIPARAMBLOCK_CONTRACTID);
if (!block)
return NS_ERROR_FAILURE;
@ -280,7 +282,8 @@ nsNSSDialogs::ConfirmCertExpired(nsIInterfaceRequestor *socketInfo,
*_retval = PR_FALSE;
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
nsCOMPtr<nsIPKIParamBlock> block =
do_CreateInstance(NS_PKIPARAMBLOCK_CONTRACTID);
if (!block)
return NS_ERROR_FAILURE;
@ -358,7 +361,8 @@ nsNSSDialogs::NotifyCrlNextupdate(nsIInterfaceRequestor *socketInfo,
{
nsresult rv;
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
nsCOMPtr<nsIPKIParamBlock> block =
do_CreateInstance(NS_PKIPARAMBLOCK_CONTRACTID);
nsCOMPtr<nsIDialogParamBlock> 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<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID,&rv);
nsCOMPtr<nsIPKIParamBlock> 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<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
nsCOMPtr<nsIPKIParamBlock> 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<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
nsCOMPtr<nsIDialogParamBlock> 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<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
nsCOMPtr<nsIDialogParamBlock> 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<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
nsCOMPtr<nsIDialogParamBlock> 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<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
nsCOMPtr<nsIDialogParamBlock> 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<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
nsCOMPtr<nsIDialogParamBlock> 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<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
nsCOMPtr<nsIPKIParamBlock> 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<nsIDOMWindowInternal> parent = do_GetInterface(aCtx);
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
nsCOMPtr<nsIDialogParamBlock> 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<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
nsCOMPtr<nsIPKIParamBlock> block =
do_CreateInstance(NS_PKIPARAMBLOCK_CONTRACTID);
if (!block)
return NS_ERROR_FAILURE;

View File

@ -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<nsIStringBundleService> service =
do_GetService(StringBundleServiceCID, &rv);
do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
nsString formattedString;
rv = getErrorMessage(err, hostNameU, nssComponent, formattedString);

View File

@ -163,7 +163,7 @@ nsresult nsMIMEInfoOS2::LoadUriInternal(nsIURI * aURL)
/* Convert SimpleURI to StandardURL */
nsresult rv;
nsCOMPtr<nsIURI> uri = do_CreateInstance(kStandardURLCID, &rv);
nsCOMPtr<nsIURI> uri = do_CreateInstance(NS_STANDARDURL_CONTRACTID, &rv);
if (NS_FAILED(rv)) {
return NS_ERROR_FAILURE;
}

View File

@ -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

View File

@ -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<nsIPrinterEnumerator> 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<nsIPrinterEnumerator> prtEnum = do_GetService(kPrinterEnumeratorCID,
&rv);
nsCOMPtr<nsIPrinterEnumerator> 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<nsIPrinterEnumerator> prtEnum = do_GetService(kPrinterEnumeratorCID,
&rv);
nsCOMPtr<nsIPrinterEnumerator> prtEnum =
do_GetService(NS_PRINTER_ENUMERATOR_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
rv = prtEnum->InitPrintSettingsFromPrinter(aPrinterName, aPrintSettings);

View File

@ -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<nsIWindowMediator> mediator(do_GetService(kWindowMediatorCID));
nsCOMPtr<nsIWindowMediator> 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<nsIWindowMediator> mediator(do_GetService(kWindowMediatorCID));
nsCOMPtr<nsIWindowMediator> 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<nsIWindowMediator> windowMediator(do_GetService(kWindowMediatorCID));
nsCOMPtr<nsIWindowMediator> windowMediator(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID));
if (windowMediator)
windowMediator->UpdateWindowTimeStamp(static_cast<nsIXULWindow*>(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<nsIWindowMediator> windowMediator(do_GetService(kWindowMediatorCID));
nsCOMPtr<nsIWindowMediator> 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<nsIWindowMediator> mediator(do_GetService(kWindowMediatorCID));
nsCOMPtr<nsIWindowMediator> 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<nsIWindowMediator> mediator(do_GetService(kWindowMediatorCID));
nsCOMPtr<nsIWindowMediator> 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<nsIWindowMediator> mediator(do_GetService(kWindowMediatorCID));
nsCOMPtr<nsIWindowMediator> mediator(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID));
if(!mediator)
return;

View File

@ -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<nsIStringBundleService> bundleSvc =
do_GetService( kStringBundleServiceCID );
do_GetService(NS_STRINGBUNDLE_CONTRACTID);
if (!bundleSvc)
return PR_FALSE;