| Index: content/renderer/service_worker/service_worker_script_context.h
|
| diff --git a/content/renderer/service_worker/service_worker_script_context.h b/content/renderer/service_worker/service_worker_script_context.h
|
| index d7f59b30ea1ad251a00ec2e9b3411961d7337a3c..291691e93f68e0d9b3ac60f633c72cf6d3032860 100644
|
| --- a/content/renderer/service_worker/service_worker_script_context.h
|
| +++ b/content/renderer/service_worker/service_worker_script_context.h
|
| @@ -10,15 +10,19 @@
|
|
|
| #include "base/basictypes.h"
|
| #include "base/id_map.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| #include "base/strings/string16.h"
|
| #include "content/child/webmessageportchannel_impl.h"
|
| #include "content/common/service_worker/service_worker_types.h"
|
| +#include "content/renderer/service_worker/service_worker_cache_storage_dispatcher.h"
|
| #include "third_party/WebKit/public/platform/WebMessagePortChannel.h"
|
| +#include "third_party/WebKit/public/platform/WebServiceWorkerCacheStorage.h"
|
| #include "third_party/WebKit/public/platform/WebServiceWorkerClientsInfo.h"
|
| #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h"
|
|
|
| namespace blink {
|
| class WebServiceWorkerContextProxy;
|
| +class WebServiceWorkerCacheStorage;
|
| }
|
|
|
| namespace IPC {
|
| @@ -28,6 +32,7 @@ class Message;
|
| namespace content {
|
|
|
| class EmbeddedWorkerContextClient;
|
| +class ServiceWorkerCacheStorageDispatcher;
|
|
|
| // TODO(kinuko): This should implement WebServiceWorkerContextClient
|
| // rather than having EmbeddedWorkerContextClient implement it.
|
| @@ -57,12 +62,21 @@ class ServiceWorkerScriptContext {
|
| const base::string16& message,
|
| scoped_ptr<blink::WebMessagePortChannelArray> channels);
|
|
|
| + // Send a message to the browser. Takes ownership of message.
|
| + void Send(IPC::Message* message);
|
| +
|
| + // Get routing_id for sending message to the ServiceWorkerVersion
|
| + // in the browser process.
|
| + int GetRoutingID() const;
|
| +
|
| + blink::WebServiceWorkerCacheStorage* cache_storage() {
|
| + return cache_storage_dispatcher_.get();
|
| + }
|
| +
|
| private:
|
| typedef IDMap<blink::WebServiceWorkerClientsCallbacks, IDMapOwnPointer>
|
| ClientsCallbacksMap;
|
|
|
| - // Send a message to the browser.
|
| - void Send(IPC::Message* message);
|
|
|
| void OnActivateEvent(int request_id);
|
| void OnInstallEvent(int request_id, int active_version_id);
|
| @@ -75,9 +89,8 @@ class ServiceWorkerScriptContext {
|
| void OnDidGetClientDocuments(
|
| int request_id, const std::vector<int>& client_ids);
|
|
|
| - // Get routing_id for sending message to the ServiceWorkerVersion
|
| - // in the browser process.
|
| - int GetRoutingID() const;
|
| +
|
| + scoped_ptr<ServiceWorkerCacheStorageDispatcher> cache_storage_dispatcher_;
|
|
|
| // Not owned; embedded_context_ owns this.
|
| EmbeddedWorkerContextClient* embedded_context_;
|
|
|