Bug 1410209, part 2 - Disambiguate some service worker runnable names. r=bkelly draft
authorAndrew McCreight <continuation@gmail.com>
Fri, 27 Oct 2017 10:45:52 -0700
changeset 714057 479326c3a67ea5125a993155c2039926631d256d
parent 714056 b8df056b3ae68aaf3db10f1ee7e5440a2260fb71
child 714058 c9b2a42254043923bfae38f6b4e1e1c5194d40f5
push id93832
push userbmo:continuation@gmail.com
push dateThu, 21 Dec 2017 16:57:49 +0000
reviewersbkelly
bugs1410209
milestone59.0a1
Bug 1410209, part 2 - Disambiguate some service worker runnable names. r=bkelly With part 3, these names are used to identify the runnables to the XPCOM leak checking system. There are some other classes that already use a few of these names, so change them to something unique. MozReview-Commit-ID: 5AN7tG5yKBk
dom/workers/ServiceWorkerJob.cpp
dom/workers/ServiceWorkerPrivate.cpp
dom/workers/ServiceWorkerRegistrationInfo.cpp
--- a/dom/workers/ServiceWorkerJob.cpp
+++ b/dom/workers/ServiceWorkerJob.cpp
@@ -222,17 +222,17 @@ ServiceWorkerJob::Finish(ErrorResult& aR
     mFinalCallback = nullptr;
   }
 
   // The callback might not consume the error.
   aRv.SuppressException();
 
   // Async release this object to ensure that our caller methods complete
   // as well.
-  NS_ReleaseOnMainThreadSystemGroup("ServiceWorkerJob",
+  NS_ReleaseOnMainThreadSystemGroup("ServiceWorkerJobProxyRunnable",
     kungFuDeathGrip.forget(), true /* always proxy */);
 }
 
 void
 ServiceWorkerJob::Finish(nsresult aRv)
 {
   ErrorResult converted(aRv);
   Finish(converted);
--- a/dom/workers/ServiceWorkerPrivate.cpp
+++ b/dom/workers/ServiceWorkerPrivate.cpp
@@ -1012,17 +1012,17 @@ ServiceWorkerPrivate::SendPushEvent(cons
 {
   nsresult rv = SpawnWorkerIfNeeded(PushEvent, nullptr);
   NS_ENSURE_SUCCESS(rv, rv);
 
   RefPtr<KeepAliveToken> token = CreateEventKeepAliveToken();
 
   nsMainThreadPtrHandle<ServiceWorkerRegistrationInfo> regInfo(
     new nsMainThreadPtrHolder<ServiceWorkerRegistrationInfo>(
-      "ServiceWorkerRegistrationInfo", aRegistration, false));
+      "ServiceWorkerRegistrationInfoProxy", aRegistration, false));
 
   RefPtr<WorkerRunnable> r = new SendPushEventRunnable(mWorkerPrivate,
                                                        token,
                                                        aMessageId,
                                                        aData,
                                                        regInfo);
 
   if (mInfo->State() == ServiceWorkerState::Activating) {
@@ -1755,17 +1755,17 @@ ServiceWorkerPrivate::SendFetchEvent(nsI
   }
 
   nsMainThreadPtrHandle<nsIInterceptedChannel> handle(
     new nsMainThreadPtrHolder<nsIInterceptedChannel>(
       "nsIInterceptedChannel", aChannel, false));
 
   nsMainThreadPtrHandle<ServiceWorkerRegistrationInfo> regInfo(
     new nsMainThreadPtrHolder<ServiceWorkerRegistrationInfo>(
-      "ServiceWorkerRegistrationInfo", registration, false));
+      "ServiceWorkerRegistrationInfoProxy", registration, false));
 
   RefPtr<KeepAliveToken> token = CreateEventKeepAliveToken();
 
 
   RefPtr<FetchEventRunnable> r =
     new FetchEventRunnable(mWorkerPrivate, token, handle,
                            mInfo->ScriptSpec(), regInfo,
                            aClientId, aIsReload, newWorkerCreated);
--- a/dom/workers/ServiceWorkerRegistrationInfo.cpp
+++ b/dom/workers/ServiceWorkerRegistrationInfo.cpp
@@ -280,17 +280,17 @@ ServiceWorkerRegistrationInfo::Activate(
   nsCOMPtr<nsIRunnable> failRunnable = NewRunnableMethod<bool>(
     "dom::workers::ServiceWorkerRegistrationInfo::FinishActivate",
     this,
     &ServiceWorkerRegistrationInfo::FinishActivate,
     false /* success */);
 
   nsMainThreadPtrHandle<ServiceWorkerRegistrationInfo> handle(
     new nsMainThreadPtrHolder<ServiceWorkerRegistrationInfo>(
-      "ServiceWorkerRegistrationInfo", this));
+      "ServiceWorkerRegistrationInfoProxy", this));
   RefPtr<LifeCycleEventCallback> callback = new ContinueActivateRunnable(handle);
 
   ServiceWorkerPrivate* workerPrivate = mActiveWorker->WorkerPrivate();
   MOZ_ASSERT(workerPrivate);
   nsresult rv = workerPrivate->SendLifeCycleEvent(NS_LITERAL_STRING("activate"),
                                                   callback, failRunnable);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(failRunnable));