Bug 500167 http should use contractids for other services
authortimeless@mozdev.org
Sat, 27 Jun 2009 18:42:51 -0700
changeset 29780 6cf5544090bc
parent 29779 a4b3c7bb2fb0
child 29781 fe6e0d8924bd
push id106
push userhsivonen@iki.fi
push dateSun, 28 Jun 2009 17:44:42 +0000
bugs500167
milestone1.9.2a1pre
Bug 500167 http should use contractids for other services r=biesi sr=biesi
netwerk/protocol/http/src/nsHttpConnection.cpp
netwerk/protocol/http/src/nsHttpConnectionMgr.cpp
netwerk/protocol/http/src/nsHttpHandler.cpp
--- a/netwerk/protocol/http/src/nsHttpConnection.cpp
+++ b/netwerk/protocol/http/src/nsHttpConnection.cpp
@@ -426,17 +426,17 @@ nsHttpConnection::ResumeRecv()
 nsresult
 nsHttpConnection::CreateTransport(PRUint8 caps)
 {
     nsresult rv;
 
     NS_PRECONDITION(!mSocketTransport, "unexpected");
 
     nsCOMPtr<nsISocketTransportService> sts =
-            do_GetService(kSocketTransportServiceCID, &rv);
+            do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv);
     if (NS_FAILED(rv)) return rv;
 
     // configure the socket type based on the connection type requested.
     const char* types[1];
 
     if (mConnInfo->UsingSSL())
         types[0] = "ssl";
     else
--- a/netwerk/protocol/http/src/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/src/nsHttpConnectionMgr.cpp
@@ -101,17 +101,17 @@ nsHttpConnectionMgr::Init(PRUint16 maxCo
                           PRUint16 maxPersistConnsPerHost,
                           PRUint16 maxPersistConnsPerProxy,
                           PRUint16 maxRequestDelay,
                           PRUint16 maxPipelinedRequests)
 {
     LOG(("nsHttpConnectionMgr::Init\n"));
 
     nsresult rv;
-    nsCOMPtr<nsIEventTarget> sts = do_GetService(kSocketTransportServiceCID, &rv);
+    nsCOMPtr<nsIEventTarget> sts = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv);
     if (NS_FAILED(rv)) return rv;
 
     nsAutoMonitor mon(mMonitor);
 
     // do nothing if already initialized
     if (mSocketThreadTarget)
         return NS_OK;
 
--- a/netwerk/protocol/http/src/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/src/nsHttpHandler.cpp
@@ -212,17 +212,17 @@ nsHttpHandler::Init()
     nsresult rv;
 
     LOG(("nsHttpHandler::Init\n"));
 
     rv = nsHttp::CreateAtomTable();
     if (NS_FAILED(rv))
         return rv;
 
-    mIOService = do_GetService(kIOServiceCID, &rv);
+    mIOService = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
     if (NS_FAILED(rv)) {
         NS_WARNING("unable to continue without io service");
         return rv;
     }
 
     InitUserAgentComponents();
 
     // monitor some preference changes
@@ -458,29 +458,29 @@ nsHttpHandler::GetCacheSession(nsCacheSt
     return NS_OK;
 }
 
 nsresult
 nsHttpHandler::GetStreamConverterService(nsIStreamConverterService **result)
 {
     if (!mStreamConvSvc) {
         nsresult rv;
-        mStreamConvSvc = do_GetService(kStreamConverterServiceCID, &rv);
+        mStreamConvSvc = do_GetService(NS_STREAMCONVERTERSERVICE_CONTRACTID, &rv);
         if (NS_FAILED(rv)) return rv;
     }
     *result = mStreamConvSvc;
     NS_ADDREF(*result);
     return NS_OK;
 }
 
 nsICookieService *
 nsHttpHandler::GetCookieService()
 {
     if (!mCookieService)
-        mCookieService = do_GetService(kCookieServiceCID);
+        mCookieService = do_GetService(NS_COOKIESERVICE_CONTRACTID);
     return mCookieService;
 }
 
 nsresult 
 nsHttpHandler::GetIOService(nsIIOService** result)
 {
     NS_ADDREF(*result = mIOService);
     return NS_OK;
@@ -1073,17 +1073,17 @@ nsHttpHandler::PrefsChanged(nsIPrefBranc
         rv = prefs->GetCharPref(HTTP_PREF("default-socket-type"),
                                 getter_Copies(sval));
         if (NS_SUCCEEDED(rv)) {
             if (sval.IsEmpty())
                 mDefaultSocketType.Adopt(0);
             else {
                 // verify that this socket type is actually valid
                 nsCOMPtr<nsISocketProviderService> sps(
-                        do_GetService(kSocketProviderServiceCID));
+                        do_GetService(NS_SOCKETPROVIDERSERVICE_CONTRACTID));
                 if (sps) {
                     nsCOMPtr<nsISocketProvider> sp;
                     rv = sps->GetSocketProvider(sval, getter_AddRefs(sp));
                     if (NS_SUCCEEDED(rv)) {
                         // OK, this looks like a valid socket provider.
                         mDefaultSocketType.Assign(sval);
                     }
                 }
@@ -1513,17 +1513,17 @@ nsHttpHandler::NewProxiedChannel(nsIURI 
 
     if (https) {
         // enable pipelining over SSL if requested
         if (mPipeliningOverSSL)
             caps |= NS_HTTP_ALLOW_PIPELINING;
 
         // HACK: make sure PSM gets initialized on the main thread.
         nsCOMPtr<nsISocketProviderService> spserv =
-                do_GetService(kSocketProviderServiceCID);
+                do_GetService(NS_SOCKETPROVIDERSERVICE_CONTRACTID);
         if (spserv) {
             nsCOMPtr<nsISocketProvider> provider;
             spserv->GetSocketProvider("ssl", getter_AddRefs(provider));
         }
     }
 
     rv = httpChannel->Init(uri, caps, proxyInfo);