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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp

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: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
index 7513bbb092d5bb791ce7f32f702d52be504ab967..d1c8073e4a06e4cb3ae626be6e510840c57ae49f 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
@@ -88,6 +88,20 @@ String ServiceWorkerRegistration::scope() const {
return handle_->Registration()->Scope().GetString();
}
+String ServiceWorkerRegistration::updateViaCache() const {
+ switch (handle_->Registration()->UpdateViaCache()) {
+ case WebServiceWorkerUpdateViaCache::kImports:
+ return "imports";
+ case WebServiceWorkerUpdateViaCache::kAll:
+ return "all";
+ case WebServiceWorkerUpdateViaCache::kNone:
+ return "never";
nhiroki 2017/07/21 04:39:46 "never" -> "none"?
yuryu 2017/08/03 04:20:05 Done.
+ default:
nhiroki 2017/07/21 04:39:46 I'd prefer to avoid 'default' as much as possible
yuryu 2017/08/03 04:20:05 Done.
+ return "imports";
+ }
+ return "imports";
+}
+
ScriptPromise ServiceWorkerRegistration::update(ScriptState* script_state) {
ServiceWorkerContainerClient* client =
ServiceWorkerContainerClient::From(GetExecutionContext());

Powered by Google App Engine
This is Rietveld 408576698