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

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

Issue 2771823002: Implement updateViaCache flag and no-cache by default for main service worker scripts
Patch Set: fix tests Created 3 years, 9 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/ServiceWorkerContainer.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
index e8449e87716a5314e28d9c30e18ba9642260bc96..8771be830f70f2b94f37aa7e2f854562339e5405 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
@@ -155,6 +155,7 @@ void ServiceWorkerContainer::registerServiceWorkerImpl(
ExecutionContext* executionContext,
const KURL& rawScriptURL,
const KURL& scope,
+ bool useCache,
std::unique_ptr<RegistrationCallbacks> callbacks) {
if (!m_provider) {
callbacks->onError(
@@ -259,7 +260,7 @@ void ServiceWorkerContainer::registerServiceWorkerImpl(
}
}
- m_provider->registerServiceWorker(patternURL, scriptURL,
+ m_provider->registerServiceWorker(patternURL, scriptURL, useCache,
std::move(callbacks));
}
@@ -292,8 +293,10 @@ ScriptPromise ServiceWorkerContainer::registerServiceWorker(
else
patternURL = executionContext->completeURL(options.scope());
+ bool useCache = options.useCache();
+
registerServiceWorkerImpl(
- executionContext, scriptURL, patternURL,
+ executionContext, scriptURL, patternURL, useCache,
WTF::makeUnique<CallbackPromiseAdapter<ServiceWorkerRegistration,
ServiceWorkerErrorForUpdate>>(
resolver));

Powered by Google App Engine
This is Rietveld 408576698