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

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

Issue 2771823002: Implement updateViaCache flag and no-cache by default for main service worker scripts
Patch Set: Move API change to another patch and address comments Created 3 years, 5 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_register_job.cc
diff --git a/content/browser/service_worker/service_worker_register_job.cc b/content/browser/service_worker/service_worker_register_job.cc
index 033232bb40c676d6785a8f4dc5e079f0365b1482..1aadbff0c2d09f93785331c446548122eedbcc08 100644
--- a/content/browser/service_worker/service_worker_register_job.cc
+++ b/content/browser/service_worker/service_worker_register_job.cc
@@ -74,6 +74,7 @@ ServiceWorkerRegisterJob::ServiceWorkerRegisterJob(
job_type_(REGISTRATION_JOB),
pattern_(options.scope),
script_url_(script_url),
+ update_via_cache_(options.update_via_cache),
phase_(INITIAL),
doom_installing_worker_(false),
is_promise_resolved_(false),
@@ -91,6 +92,7 @@ ServiceWorkerRegisterJob::ServiceWorkerRegisterJob(
: context_(context),
job_type_(UPDATE_JOB),
pattern_(registration->pattern()),
+ update_via_cache_(registration->update_via_cache()),
phase_(INITIAL),
doom_installing_worker_(false),
is_promise_resolved_(false),
@@ -320,7 +322,8 @@ void ServiceWorkerRegisterJob::RegisterAndContinue() {
}
set_registration(new ServiceWorkerRegistration(
- ServiceWorkerRegistrationOptions(pattern_), registration_id, context_));
+ ServiceWorkerRegistrationOptions(pattern_, update_via_cache_),
+ registration_id, context_));
AddRegistrationToMatchingProviderHosts(registration());
UpdateAndContinue();
}

Powered by Google App Engine
This is Rietveld 408576698