Bug 1230341 Hold a strong ref in service worker NS_NewRunnableMethodWithArg uses. r=ehsan a=abillings

This commit is contained in:
Ben Kelly 2015-12-04 18:03:47 -08:00
parent ebc67a0d2f
commit b21a412c95

View File

@ -1079,7 +1079,7 @@ public:
// Step 8 "Queue a task..." for updatefound.
nsCOMPtr<nsIRunnable> upr =
NS_NewRunnableMethodWithArg<ServiceWorkerRegistrationInfo*>(
NS_NewRunnableMethodWithArg<RefPtr<ServiceWorkerRegistrationInfo>>(
swm,
&ServiceWorkerManager::FireUpdateFoundOnServiceWorkerRegistrations,
mRegistration);
@ -1767,9 +1767,8 @@ ServiceWorkerRegistrationInfo::Activate()
// "Queue a task to fire a simple event named controllerchange..."
nsCOMPtr<nsIRunnable> controllerChangeRunnable =
NS_NewRunnableMethodWithArg<ServiceWorkerRegistrationInfo*>(swm,
&ServiceWorkerManager::FireControllerChange,
this);
NS_NewRunnableMethodWithArg<RefPtr<ServiceWorkerRegistrationInfo>>(
swm, &ServiceWorkerManager::FireControllerChange, this);
NS_DispatchToMainThread(controllerChangeRunnable);
nsCOMPtr<nsIRunnable> failRunnable =