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

Unified Diff: content/browser/service_worker/service_worker_context_wrapper.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/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 fbb00d4fc0fd42a3bd650f6ce2cb7cc28cbcfdd0..e16f4cbf0301850ca372be89d47fcd9ac7f026b5 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -221,16 +221,13 @@ static void FinishRegistrationOnIO(
void ServiceWorkerContextWrapper::RegisterServiceWorker(
const GURL& pattern,
const GURL& script_url,
+ blink::WebServiceWorkerUpdateViaCache update_via_cache,
const ResultCallback& continuation) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
- BrowserThread::IO,
- FROM_HERE,
- base::Bind(&ServiceWorkerContextWrapper::RegisterServiceWorker,
- this,
- pattern,
- script_url,
- continuation));
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&ServiceWorkerContextWrapper::RegisterServiceWorker, this,
+ pattern, script_url, update_via_cache, continuation));
return;
}
if (!context_core_) {
@@ -238,9 +235,10 @@ void ServiceWorkerContextWrapper::RegisterServiceWorker(
base::Bind(continuation, false));
return;
}
+ ServiceWorkerRegistrationOptions options(net::SimplifyUrlForRequest(pattern),
+ update_via_cache);
context()->RegisterServiceWorker(
- net::SimplifyUrlForRequest(pattern),
- net::SimplifyUrlForRequest(script_url), NULL /* provider_host */,
+ net::SimplifyUrlForRequest(script_url), options, NULL /* provider_host */,
base::Bind(&FinishRegistrationOnIO, continuation));
}

Powered by Google App Engine
This is Rietveld 408576698