Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1335)

Unified Diff: content/browser/service_worker/service_worker_context_wrapper.cc

Issue 2393503002: Don't speculatively start ServiceWorker if it doesn't have FetchEvent handler (Closed)
Patch Set: add test Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_context_wrapper.cc
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc
index 64ae3ea762f36fabfff18ff825a3dd97d0accf63..eeac4d3bfa1a06a2f5aa0af8950ffaa784dac6ae 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -341,6 +341,13 @@ void ServiceWorkerContextWrapper::DidFindRegistrationForNavigationHint(
return;
}
+ if (registration->active_version()->fetch_handler_existence() ==
+ ServiceWorkerVersion::FetchHandlerExistence::DOES_NOT_EXIST) {
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ base::Bind(callback, false));
+ return;
+ }
+
// Add the process reference of |render_process_id| not to launch a new
// renderer process for the service worker.
context_core_->process_manager()->AddProcessReferenceToPattern(

Powered by Google App Engine
This is Rietveld 408576698