| 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 94ab73f67e2d59d2a68035e03932f6f5b4b50b8c..22c989b4ce8254ddfd423421af59aec9cec2f69c 100644
|
| --- a/content/public/browser/service_worker_context.h
|
| +++ b/content/public/browser/service_worker_context.h
|
| @@ -11,8 +11,13 @@
|
| #include "base/basictypes.h"
|
| #include "base/callback_forward.h"
|
| #include "content/public/browser/service_worker_usage_info.h"
|
| +#include "net/base/completion_callback.h"
|
| #include "url/gurl.h"
|
|
|
| +namespace net {
|
| +class URLRequest;
|
| +}
|
| +
|
| namespace content {
|
|
|
| // Represents the per-StoragePartition ServiceWorker data.
|
| @@ -36,6 +41,10 @@ class ServiceWorkerContext {
|
| // Must be called from the IO thread.
|
| static bool IsExcludedHeaderNameForFetchEvent(const std::string& header_name);
|
|
|
| + // Retrieves the ServiceWorkerContext, if any, associated with |request|.
|
| + CONTENT_EXPORT static ServiceWorkerContext* GetServiceWorkerContext(
|
| + net::URLRequest* request);
|
| +
|
| // 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
|
| @@ -64,6 +73,13 @@ class ServiceWorkerContext {
|
|
|
| // TODO(jyasskin): Provide a way to SendMessage to a Scope.
|
|
|
| + // Determines if a request for 'url' can be satisfied while offline.
|
| + // This method always completes asynchronously.
|
| + virtual void CanHandleMainResourceOffline(const GURL& url,
|
| + const GURL& first_party,
|
| + const net::CompletionCallback&
|
| + callback) = 0;
|
| +
|
| // Methods used in response to browsing data and quota manager requests.
|
| virtual void GetAllOriginsInfo(const GetUsageInfoCallback& callback) = 0;
|
| virtual void DeleteForOrigin(const GURL& origin_url) = 0;
|
|
|