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

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: 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: 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..0a653754002305d140c935316157a7a4da72e42f 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
@@ -88,6 +88,21 @@ 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 "none";
+ case WebServiceWorkerUpdateViaCache::kUnknown:
+ break;
+ }
+ NOTREACHED();
+ return "imports";
+}
+
ScriptPromise ServiceWorkerRegistration::update(ScriptState* script_state) {
ServiceWorkerContainerClient* client =
ServiceWorkerContainerClient::From(GetExecutionContext());

Powered by Google App Engine
This is Rietveld 408576698