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

Unified Diff: content/public/browser/service_worker_context.h

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/public/browser/service_worker_context.h
diff --git a/content/public/browser/service_worker_context.h b/content/public/browser/service_worker_context.h
index 1371bebfa5257b8e198a8dfdf5fe198476cbd1db..6764c2ccf4ca7ccec6e9e4dfce85e42abbcab337 100644
--- a/content/public/browser/service_worker_context.h
+++ b/content/public/browser/service_worker_context.h
@@ -12,6 +12,10 @@
#include "content/public/browser/service_worker_usage_info.h"
#include "url/gurl.h"
+namespace blink {
+enum class WebServiceWorkerUpdateViaCache;
+} // namespace blink
+
namespace content {
class ServiceWorkerContextObserver;
@@ -81,9 +85,10 @@ class ServiceWorkerContext {
virtual void RemoveObserver(ServiceWorkerContextObserver* observer) = 0;
// Equivalent to calling navigator.serviceWorker.register(script_url, {scope:
- // pattern}) from a renderer, except that |pattern| is an absolute URL instead
- // of relative to some current origin. |callback| is passed true when the JS
- // promise is fulfilled or false when the JS promise is rejected.
+ // pattern, updateViaCache: update_via_cache}) from a renderer, except that
+ // |pattern| is an absolute URL instead of relative to some current origin.
+ // |callback| is passed true when the JS promise is fulfilled or false when
+ // the JS promise is rejected.
//
// The registration can fail if:
// * |script_url| is on a different origin from |pattern|
@@ -94,9 +99,11 @@ class ServiceWorkerContext {
//
// This function can be called from any thread, but the callback will always
// be called on the UI thread.
- virtual void RegisterServiceWorker(const Scope& pattern,
- const GURL& script_url,
- const ResultCallback& callback) = 0;
+ virtual void RegisterServiceWorker(
+ const Scope& pattern,
+ const GURL& script_url,
+ blink::WebServiceWorkerUpdateViaCache update_via_cache,
+ const ResultCallback& callback) = 0;
// Mechanism for embedder to increment/decrement ref count of a service
// worker.
« no previous file with comments | « content/common/service_worker/service_worker_types.cc ('k') | content/public/test/mock_service_worker_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698