Bug 1276052 - Fix NS_ConvertUTF16toUTF8 usage. r=smaug, a=lizzard
authorNicholas Hurley <hurley@todesschaf.org>
Fri, 27 May 2016 10:28:15 -0700
changeset 325131 82ec5faa2397e9dd0f6c881e5bdcf773e0ba9a88
parent 325130 5337f17b3c1fd9dc73f6e15956f71e8fb029e1ff
child 325132 c0ead5950258e5a5db6e4bd9a0714b500b780d8d
push id9692
push usercbook@mozilla.com
push dateWed, 22 Jun 2016 07:36:20 +0000
treeherdermozilla-aurora@c0ead5950258 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, lizzard
bugs1276052
milestone49.0a2
Bug 1276052 - Fix NS_ConvertUTF16toUTF8 usage. r=smaug, a=lizzard MozReview-Commit-ID: BLvxeSWpF6h
uriloader/prefetch/nsPrefetchService.cpp
--- a/uriloader/prefetch/nsPrefetchService.cpp
+++ b/uriloader/prefetch/nsPrefetchService.cpp
@@ -819,17 +819,18 @@ nsPrefetchService::Observe(nsISupports  
     LOG(("nsPrefetchService::Observe [topic=%s]\n", aTopic));
 
     if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
         StopPrefetching();
         EmptyQueue();
         mDisabled = true;
     }
     else if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) {
-        const char *pref = NS_ConvertUTF16toUTF8(aData).get();
+        const nsCString converted = NS_ConvertUTF16toUTF8(aData);
+        const char* pref = converted.get();
         if (!strcmp(pref, PREFETCH_PREF)) {
             if (Preferences::GetBool(PREFETCH_PREF, false)) {
                 if (mDisabled) {
                     LOG(("enabling prefetching\n"));
                     mDisabled = false;
                     AddProgressListener();
                 }
             } else {