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
--- 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));