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

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

Issue 2771823002: Implement updateViaCache flag and no-cache by default for main service worker scripts
Patch Set: fix IPC Created 3 years, 4 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_storage.cc
diff --git a/content/browser/service_worker/service_worker_storage.cc b/content/browser/service_worker/service_worker_storage.cc
index a810d71ade0c68a8b18483af5b1406313d922bcb..12f4b9ec927758c106559dac0a8db599604bef71 100644
--- a/content/browser/service_worker/service_worker_storage.cc
+++ b/content/browser/service_worker/service_worker_storage.cc
@@ -390,6 +390,7 @@ void ServiceWorkerStorage::StoreRegistration(
ServiceWorkerDatabase::RegistrationData data;
data.registration_id = registration->id();
data.scope = registration->pattern();
+ data.update_via_cache = registration->update_via_cache();
data.script = version->script_url();
data.has_fetch_handler = version->fetch_handler_existence() ==
ServiceWorkerVersion::FetchHandlerExistence::EXISTS;
@@ -1147,6 +1148,7 @@ void ServiceWorkerStorage::DidGetAllRegistrationsInfos(
ServiceWorkerRegistrationInfo info;
info.pattern = registration_data.scope;
+ info.update_via_cache = registration_data.update_via_cache;
info.registration_id = registration_data.registration_id;
info.stored_version_size_bytes =
registration_data.resources_total_size_bytes;
@@ -1337,8 +1339,8 @@ ServiceWorkerStorage::GetOrCreateRegistration(
return registration;
registration = new ServiceWorkerRegistration(
- ServiceWorkerRegistrationOptions(data.scope), data.registration_id,
- context_);
+ ServiceWorkerRegistrationOptions(data.scope, data.update_via_cache),
+ data.registration_id, context_);
registration->set_resources_total_size_bytes(data.resources_total_size_bytes);
registration->set_last_update_check(data.last_update_check);
if (pending_deletions_.find(data.registration_id) !=

Powered by Google App Engine
This is Rietveld 408576698