diff --git a/content/base/src/nsDOMParser.cpp b/content/base/src/nsDOMParser.cpp index 7ab73a698ae..426aa9e37a5 100644 --- a/content/base/src/nsDOMParser.cpp +++ b/content/base/src/nsDOMParser.cpp @@ -285,10 +285,8 @@ ConvertWStringToStream(const PRUnichar* aStr, char* charBuf; // We want to encode the string as utf-8, so get the right encoder - NS_WITH_SERVICE(nsICharsetConverterManager, - charsetConv, - kCharsetConverterManagerCID, - &rv); + nsCOMPtr charsetConv = + do_GetService(kCharsetConverterManagerCID, &rv); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); charsetStr.AssignWithConversion("UTF-8"); @@ -381,7 +379,7 @@ nsDOMParser::ParseFromStream(nsIInputStream *stream, // First try to find a base URI for the document we're creating nsCOMPtr cc; - NS_WITH_SERVICE(nsIXPConnect, xpc, nsIXPConnect::GetCID(), &rv); + nsCOMPtr xpc(do_GetService(nsIXPConnect::GetCID(), &rv)); if(NS_SUCCEEDED(rv)) { rv = xpc->GetCurrentNativeCallContext(getter_AddRefs(cc)); } @@ -391,8 +389,8 @@ nsDOMParser::ParseFromStream(nsIInputStream *stream, rv = cc->GetJSContext(&cx); if (NS_FAILED(rv)) return NS_ERROR_FAILURE; - NS_WITH_SERVICE(nsIScriptSecurityManager, secMan, - NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv); + nsCOMPtr secMan = + do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv); if (NS_SUCCEEDED(rv)) { rv = secMan->GetSubjectPrincipal(getter_AddRefs(principal)); if (NS_SUCCEEDED(rv)) { diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index 4f9df0a640b..0f574646af7 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -676,7 +676,7 @@ nsXMLHttpRequest::Open(const char *method, const char *url) char* password = nsnull; nsCOMPtr cc; - NS_WITH_SERVICE(nsIXPConnect, xpc, nsIXPConnect::GetCID(), &rv); + nsCOMPtr xpc(do_GetService(nsIXPConnect::GetCID(), &rv)); if(NS_SUCCEEDED(rv)) { rv = xpc->GetCurrentNativeCallContext(getter_AddRefs(cc)); } @@ -694,8 +694,8 @@ nsXMLHttpRequest::Open(const char *method, const char *url) rv = cc->GetJSContext(&cx); if (NS_FAILED(rv)) return NS_ERROR_FAILURE; - NS_WITH_SERVICE(nsIScriptSecurityManager, secMan, - NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv); + nsCOMPtr secMan = + do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv); if (NS_FAILED(rv)) return NS_ERROR_FAILURE; nsCOMPtr principal; @@ -717,7 +717,7 @@ nsXMLHttpRequest::Open(const char *method, const char *url) // Security check failed. The above call set a JS exception. The // following lines ensure that the exception is propagated. - NS_WITH_SERVICE(nsIXPConnect, xpc, nsIXPConnect::GetCID(), &rv); + nsCOMPtr xpc(do_GetService(nsIXPConnect::GetCID(), &rv)); nsCOMPtr cc; if(NS_SUCCEEDED(rv)) xpc->GetCurrentNativeCallContext(getter_AddRefs(cc)); @@ -765,10 +765,8 @@ nsXMLHttpRequest::GetStreamForWString(const PRUnichar* aStr, char* postData; // We want to encode the string as utf-8, so get the right encoder - NS_WITH_SERVICE(nsICharsetConverterManager, - charsetConv, - kCharsetConverterManagerCID, - &rv); + nsCOMPtr charsetConv = + do_GetService(kCharsetConverterManagerCID, &rv); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); charsetStr.AssignWithConversion("UTF-8"); @@ -1023,7 +1021,7 @@ nsXMLHttpRequest::Send(nsISupports *body) if (!mAsync) { nsCOMPtr cc; - NS_WITH_SERVICE(nsIXPConnect, xpc, nsIXPConnect::GetCID(), &rv); + nsCOMPtr xpc(do_GetService(nsIXPConnect::GetCID(), &rv)); if(NS_SUCCEEDED(rv)) { rv = xpc->GetCurrentNativeCallContext(getter_AddRefs(cc)); }