Bug 1325101 - Don't set fetch handler flag for events other than 'fetch'. r=bkelly

This commit is contained in:
Catalin Badea 2016-12-21 10:16:00 +08:00
Родитель 4081567a84
Коммит f6289b3f5b
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -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();
}