Bug 1044598 - Part 2: Make ServiceWorkerManager::GetServiceWorkerRegistration honor XPCOM rules; r=smaug
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 28 Jul 2014 09:57:31 -0400
changeset 196401 c3fe7fa48e459c83ca8b07036b405a8090663449
parent 196400 16c39aa85350d2b7dcebc117a398bc3b1cc763b5
child 196402 3e3eda7131a7f720bca99692c605096a5d854ca4
push id27214
push usercbook@mozilla.com
push dateTue, 29 Jul 2014 07:16:00 +0000
treeherdermozilla-central@b17cad2d1e5e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1044598
milestone34.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 1044598 - Part 2: Make ServiceWorkerManager::GetServiceWorkerRegistration honor XPCOM rules; r=smaug
dom/workers/ServiceWorkerManager.cpp
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -1208,22 +1208,22 @@ ServiceWorkerManager::GetServiceWorkerRe
     return nullptr;
   }
 
   nsCString scope = FindScopeForPath(domainInfo->mOrderedScopes, spec);
   if (scope.IsEmpty()) {
     return nullptr;
   }
 
-  ServiceWorkerRegistration* registration;
-  domainInfo->mServiceWorkerRegistrations.Get(scope, &registration);
+  nsRefPtr<ServiceWorkerRegistration> registration;
+  domainInfo->mServiceWorkerRegistrations.Get(scope, getter_AddRefs(registration));
   // ordered scopes and registrations better be in sync.
   MOZ_ASSERT(registration);
 
-  return registration;
+  return registration.forget();
 }
 
 namespace {
 /*
  * Returns string without trailing '*'.
  */
 void ScopeWithoutStar(const nsACString& aScope, nsACString& out)
 {