Index: content/browser/service_worker/service_worker_dispatcher_host.h |
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.h b/content/browser/service_worker/service_worker_dispatcher_host.h |
index 473f239c9caacba90672709e3d87f04d10fc6f89..97b50bdc6f7066770209783a6292b0e85b005e84 100644 |
--- a/content/browser/service_worker/service_worker_dispatcher_host.h |
+++ b/content/browser/service_worker/service_worker_dispatcher_host.h |
@@ -31,11 +31,20 @@ class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { |
void Init(ServiceWorkerContextWrapper* context_wrapper); |
- // BrowserIOMessageFilter implementation |
+ // BrowserMessageFilter implementation |
+ virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; |
virtual void OnDestruct() const OVERRIDE; |
virtual bool OnMessageReceived(const IPC::Message& message, |
bool* message_was_ok) OVERRIDE; |
+ // IPC::Sender implementation |
+ |
+ // Send() queues the message until the underlying channel is ready. This |
+ // class assumes that Send() can only fail after that when the renderer |
+ // process has terminated, at which point the whole instance will eventually |
+ // be destroyed. |
+ virtual bool Send(IPC::Message* message) OVERRIDE; |
+ |
void RegisterServiceWorkerHandle(scoped_ptr<ServiceWorkerHandle> handle); |
protected: |
@@ -98,6 +107,9 @@ class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { |
IDMap<ServiceWorkerHandle, IDMapOwnPointer> handles_; |
+ bool channel_ready_; // True after BrowserMessageFilter::channel_ != NULL. |
+ ScopedVector<IPC::Message> pending_messages_; |
+ |
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); |
}; |