Bug 1114554 - Patch 8 - Support waitUntil() on notificationclick event. r=baku

This was originally a part of Bug 1160527, separated due to changes in order of landing the patches.
This commit is contained in:
Nikhil Marathe 2015-06-25 18:50:26 -07:00
parent c0a2d1d0b6
commit 4215e2e637

View File

@ -2357,7 +2357,14 @@ public:
}
event->SetTrusted(true);
target->DispatchDOMEvent(nullptr, event, nullptr, nullptr);
nsRefPtr<Promise> waitUntilPromise =
DispatchExtendableEventOnWorkerScope(aCx, aWorkerPrivate->GlobalScope(), event);
if (waitUntilPromise) {
nsRefPtr<KeepAliveHandler> handler = new KeepAliveHandler(mServiceWorker);
waitUntilPromise->AppendNativeHandler(handler);
}
return true;
}
};