зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1325101 - Don't set fetch handler flag for events other than 'fetch'. r=bkelly
This commit is contained in:
Родитель
4081567a84
Коммит
f6289b3f5b
|
@ -683,12 +683,18 @@ ServiceWorkerGlobalScope::AddEventListener(
|
|||
MOZ_ASSERT(mWorkerPrivate);
|
||||
mWorkerPrivate->AssertIsOnWorkerThread();
|
||||
|
||||
DOMEventTargetHelper::AddEventListener(aType, aListener, aOptions,
|
||||
aWantsUntrusted, aRv);
|
||||
|
||||
if (!aType.EqualsLiteral("fetch")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mWorkerPrivate->WorkerScriptExecutedSuccessfully()) {
|
||||
RefPtr<Runnable> r = new ReportFetchListenerWarningRunnable(mScope);
|
||||
mWorkerPrivate->DispatchToMainThread(r.forget());
|
||||
}
|
||||
DOMEventTargetHelper::AddEventListener(aType, aListener, aOptions,
|
||||
aWantsUntrusted, aRv);
|
||||
|
||||
if (!aRv.Failed()) {
|
||||
mWorkerPrivate->SetFetchHandlerWasAdded();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче