Bug 1218315 - Replace NS_LITERAL_STRING(...).get() with MOZ_UTF16(...) on netwerk. r=nfroyd
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Wed, 28 Oct 2015 14:30:07 +0900
changeset 305127 5caf6fd04aedaf6938c66d4e8bbe9c88b6b06486
parent 305126 9a8f4587e564b2597b84b7c46f5d75ad861e874b
child 305128 18e8b44eb5651cf3ffa7693cf3129a4af56266e6
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnfroyd
bugs1218315
milestone44.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 1218315 - Replace NS_LITERAL_STRING(...).get() with MOZ_UTF16(...) on netwerk. r=nfroyd
netwerk/base/CaptivePortalService.cpp
netwerk/base/nsIOService.cpp
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/base/CaptivePortalService.cpp
+++ b/netwerk/base/CaptivePortalService.cpp
@@ -64,17 +64,17 @@ CaptivePortalService::PerformCheck()
         LOG(("Unable to get a captive portal detector\n"));
         return rv;
     }
   }
 
   LOG(("CaptivePortalService::PerformCheck - Calling CheckCaptivePortal\n"));
   mRequestInProgress = true;
   mCaptivePortalDetector->CheckCaptivePortal(
-    NS_LITERAL_STRING(kInterfaceName).get(), this);
+    MOZ_UTF16(kInterfaceName), this);
   return NS_OK;
 }
 
 nsresult
 CaptivePortalService::RearmTimer()
 {
   // Start a timer to recheck
   if (mTimer) {
@@ -159,17 +159,17 @@ CaptivePortalService::Stop()
 
   if (mTimer) {
     mTimer->Cancel();
   }
   mTimer = nullptr;
   mRequestInProgress = false;
   mStarted = false;
   if (mCaptivePortalDetector) {
-    mCaptivePortalDetector->Abort(NS_LITERAL_STRING(kInterfaceName).get());
+    mCaptivePortalDetector->Abort(MOZ_UTF16(kInterfaceName));
   }
   mCaptivePortalDetector = nullptr;
   return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // CaptivePortalService::nsICaptivePortalService
 //-----------------------------------------------------------------------------
@@ -276,17 +276,17 @@ CaptivePortalService::Observe(nsISupport
 // CaptivePortalService::nsICaptivePortalCallback
 //-----------------------------------------------------------------------------
 NS_IMETHODIMP
 CaptivePortalService::Prepare()
 {
   LOG(("CaptivePortalService::Prepare\n"));
   // XXX: Finish preparation shouldn't be called until dns and routing is available.
   if (mCaptivePortalDetector) {
-    mCaptivePortalDetector->FinishPreparation(NS_LITERAL_STRING(kInterfaceName).get());
+    mCaptivePortalDetector->FinishPreparation(MOZ_UTF16(kInterfaceName));
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 CaptivePortalService::Complete(bool success)
 {
   LOG(("CaptivePortalService::Complete(success=%d) mState=%d\n", success, mState));
--- a/netwerk/base/nsIOService.cpp
+++ b/netwerk/base/nsIOService.cpp
@@ -1045,17 +1045,17 @@ nsIOService::SetOffline(bool offline)
                 mProxyService->ReloadPAC();
 
             mLastOfflineStateChange = PR_IntervalNow();
             // don't care if notification fails
             // Only send the ONLINE notification if there is connectivity
             if (observerService && mConnectivity) {
                 observerService->NotifyObservers(subject,
                                                  NS_IOSERVICE_OFFLINE_STATUS_TOPIC,
-                                                 NS_LITERAL_STRING(NS_IOSERVICE_ONLINE).get());
+                                                 MOZ_UTF16(NS_IOSERVICE_ONLINE));
             }
         }
     }
 
     // Don't notify here, as the above notifications (if used) suffice.
     if ((mShutdown || mOfflineForProfileChange) && mOffline) {
         // be sure to try and shutdown both (even if the first fails)...
         // shutdown dns service first, because it has callbacks for socket transport
@@ -1128,17 +1128,17 @@ nsIOService::SetConnectivityInternal(boo
     }
 
     if (aConnectivity) {
         // If we were previously offline due to connectivity=false,
         // send the ONLINE notification
         observerService->NotifyObservers(
             static_cast<nsIIOService *>(this),
             NS_IOSERVICE_OFFLINE_STATUS_TOPIC,
-            NS_LITERAL_STRING(NS_IOSERVICE_ONLINE).get());
+            MOZ_UTF16(NS_IOSERVICE_ONLINE));
     } else {
         // If we were previously online and lost connectivity
         // send the OFFLINE notification
         const nsLiteralString offlineString(MOZ_UTF16(NS_IOSERVICE_OFFLINE));
         observerService->NotifyObservers(static_cast<nsIIOService *>(this),
                                          NS_IOSERVICE_GOING_OFFLINE_TOPIC,
                                          offlineString.get());
         observerService->NotifyObservers(static_cast<nsIIOService *>(this),
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -353,17 +353,17 @@ nsHttpChannel::Connect()
                 mURI->GetScheme(scheme);
                 // append the additional 's' for security to the scheme :-)
                 scheme.AppendASCII("s");
                 NS_ConvertUTF8toUTF16 reportSpec(spec);
                 NS_ConvertUTF8toUTF16 reportScheme(scheme);
 
                 const char16_t* params[] = { reportSpec.get(), reportScheme.get() };
                 uint32_t innerWindowId = mLoadInfo ? mLoadInfo->GetInnerWindowID() : 0;
-                CSP_LogLocalizedStr(NS_LITERAL_STRING("upgradeInsecureRequest").get(),
+                CSP_LogLocalizedStr(MOZ_UTF16("upgradeInsecureRequest"),
                                     params, ArrayLength(params),
                                     EmptyString(), // aSourceFile
                                     EmptyString(), // aScriptSample
                                     0, // aLineNumber
                                     0, // aColumnNumber
                                     nsIScriptError::warningFlag, "CSP",
                                     innerWindowId);