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

Unified Diff: content/child/service_worker/service_worker_dispatcher.cc

Issue 2771823002: Implement updateViaCache flag and no-cache by default for main service worker scripts
Patch Set: change useCache to updateViaCache Created 3 years, 6 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/child/service_worker/service_worker_dispatcher.cc
diff --git a/content/child/service_worker/service_worker_dispatcher.cc b/content/child/service_worker/service_worker_dispatcher.cc
index be61ffb7a3a0abe7b44e50dfc59d05269111372e..a44862057788a9de7e2ad75bbb228bfae93b1b26 100644
--- a/content/child/service_worker/service_worker_dispatcher.cc
+++ b/content/child/service_worker/service_worker_dispatcher.cc
@@ -123,6 +123,7 @@ void ServiceWorkerDispatcher::RegisterServiceWorker(
int provider_id,
const GURL& pattern,
const GURL& script_url,
+ blink::WebServiceWorkerUpdateViaCache update_via_cache,
std::unique_ptr<WebServiceWorkerRegistrationCallbacks> callbacks) {
DCHECK(callbacks);
@@ -137,13 +138,15 @@ void ServiceWorkerDispatcher::RegisterServiceWorker(
}
int request_id = pending_registration_callbacks_.Add(std::move(callbacks));
+ ServiceWorkerRegistrationOptions options(pattern, update_via_cache);
+
TRACE_EVENT_ASYNC_BEGIN2("ServiceWorker",
"ServiceWorkerDispatcher::RegisterServiceWorker",
request_id,
"Scope", pattern.spec(),
"Script URL", script_url.spec());
thread_safe_sender_->Send(new ServiceWorkerHostMsg_RegisterServiceWorker(
- CurrentWorkerId(), request_id, provider_id, pattern, script_url));
+ CurrentWorkerId(), request_id, provider_id, script_url, options));
}
void ServiceWorkerDispatcher::UpdateServiceWorker(
@@ -186,6 +189,7 @@ void ServiceWorkerDispatcher::GetRegistration(
int request_id =
pending_get_registration_callbacks_.Add(std::move(callbacks));
+
TRACE_EVENT_ASYNC_BEGIN1("ServiceWorker",
"ServiceWorkerDispatcher::GetRegistration",
request_id,

Powered by Google App Engine
This is Rietveld 408576698