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 22d13f9bd57ac84e19382a9430fc1a88f20b0199..35bbf822498bdb8bc1bf49fff3642553c2d7c60e 100644 |
--- a/content/public/browser/service_worker_context.h |
+++ b/content/public/browser/service_worker_context.h |
@@ -14,6 +14,8 @@ |
namespace content { |
+class ServiceWorkerContextObserver; |
+ |
enum class ServiceWorkerCapability { |
NO_SERVICE_WORKER, |
SERVICE_WORKER_NO_FETCH_HANDLER, |
@@ -47,6 +49,13 @@ class ServiceWorkerContext { |
// Must be called from the IO thread. |
static bool IsExcludedHeaderNameForFetchEvent(const std::string& header_name); |
+ // Returns true if |url| is within the service worker |scope|. |
+ CONTENT_EXPORT static bool ScopeMatches(const GURL& scope, const GURL& url); |
+ |
+ // Observer methods are always dispatched on the UI thread. |
+ virtual void AddObserver(ServiceWorkerContextObserver* observer) = 0; |
+ 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 |