Bug 1330868 - use contractID instead of CID to get STS service. r=mcmanus
authorShih-Chiang Chien <schien@mozilla.com>
Fri, 13 Jan 2017 10:53:53 +0800
changeset 374401 cef6e7c1fd78144c0ee954d92619f486612d9add
parent 374400 d26f3e43c32d5939ba0f17edf2b1547b1c293704
child 374402 9bfa76ba665bb5272bc4eee2f7e8774958a2a272
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs1330868
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1330868 - use contractID instead of CID to get STS service. r=mcmanus MozReview-Commit-ID: 2cuuTblXXZh
netwerk/base/nsServerSocket.cpp
netwerk/base/nsUDPSocket.cpp
--- a/netwerk/base/nsServerSocket.cpp
+++ b/netwerk/base/nsServerSocket.cpp
@@ -15,18 +15,16 @@
 #include "mozilla/Attributes.h"
 #include "mozilla/EndianUtils.h"
 #include "mozilla/net/DNS.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIFile.h"
 
 namespace mozilla { namespace net {
 
-static NS_DEFINE_CID(kSocketTransportServiceCID, NS_SOCKETTRANSPORTSERVICE_CID);
-
 //-----------------------------------------------------------------------------
 
 typedef void (nsServerSocket:: *nsServerSocketFunc)(void);
 
 static nsresult
 PostEvent(nsServerSocket *s, nsServerSocketFunc func)
 {
   nsCOMPtr<nsIRunnable> ev = NewRunnableMethod(s, func);
@@ -47,17 +45,17 @@ nsServerSocket::nsServerSocket()
   , mKeepWhenOffline(false)
 {
   // we want to be able to access the STS directly, and it may not have been
   // constructed yet.  the STS constructor sets gSocketTransportService.
   if (!gSocketTransportService)
   {
     // This call can fail if we're offline, for example.
     nsCOMPtr<nsISocketTransportService> sts =
-        do_GetService(kSocketTransportServiceCID);
+        do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID);
   }
   // make sure the STS sticks around as long as we do
   NS_IF_ADDREF(gSocketTransportService);
 }
 
 nsServerSocket::~nsServerSocket()
 {
   Close(); // just in case :)
--- a/netwerk/base/nsUDPSocket.cpp
+++ b/netwerk/base/nsUDPSocket.cpp
@@ -34,17 +34,16 @@
 #ifdef MOZ_WIDGET_GONK
 #include "NetStatistics.h"
 #endif
 
 namespace mozilla {
 namespace net {
 
 static const uint32_t UDP_PACKET_CHUNK_SIZE = 1400;
-static NS_DEFINE_CID(kSocketTransportServiceCID2, NS_SOCKETTRANSPORTSERVICE_CID);
 
 //-----------------------------------------------------------------------------
 
 typedef void (nsUDPSocket:: *nsUDPSocketFunc)(void);
 
 static nsresult
 PostEvent(nsUDPSocket *s, nsUDPSocketFunc func)
 {
@@ -270,17 +269,17 @@ nsUDPSocket::nsUDPSocket()
 {
   mAddr.raw.family = PR_AF_UNSPEC;
   // we want to be able to access the STS directly, and it may not have been
   // constructed yet.  the STS constructor sets gSocketTransportService.
   if (!gSocketTransportService)
   {
     // This call can fail if we're offline, for example.
     nsCOMPtr<nsISocketTransportService> sts =
-        do_GetService(kSocketTransportServiceCID2);
+        do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID);
   }
 
   mSts = gSocketTransportService;
 }
 
 nsUDPSocket::~nsUDPSocket()
 {
   CloseSocket();