| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
| 7 | 7 |
| 8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 public: | 27 public: |
| 28 ServiceWorkerDispatcherHost( | 28 ServiceWorkerDispatcherHost( |
| 29 int render_process_id, | 29 int render_process_id, |
| 30 MessagePortMessageFilter* message_port_message_filter); | 30 MessagePortMessageFilter* message_port_message_filter); |
| 31 | 31 |
| 32 void Init(ServiceWorkerContextWrapper* context_wrapper); | 32 void Init(ServiceWorkerContextWrapper* context_wrapper); |
| 33 | 33 |
| 34 // BrowserMessageFilter implementation | 34 // BrowserMessageFilter implementation |
| 35 virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; | 35 virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; |
| 36 virtual void OnDestruct() const OVERRIDE; | 36 virtual void OnDestruct() const OVERRIDE; |
| 37 virtual bool OnMessageReceived(const IPC::Message& message, | 37 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 38 bool* message_was_ok) OVERRIDE; | |
| 39 | 38 |
| 40 // IPC::Sender implementation | 39 // IPC::Sender implementation |
| 41 | 40 |
| 42 // Send() queues the message until the underlying channel is ready. This | 41 // Send() queues the message until the underlying channel is ready. This |
| 43 // class assumes that Send() can only fail after that when the renderer | 42 // class assumes that Send() can only fail after that when the renderer |
| 44 // process has terminated, at which point the whole instance will eventually | 43 // process has terminated, at which point the whole instance will eventually |
| 45 // be destroyed. | 44 // be destroyed. |
| 46 virtual bool Send(IPC::Message* message) OVERRIDE; | 45 virtual bool Send(IPC::Message* message) OVERRIDE; |
| 47 | 46 |
| 48 void RegisterServiceWorkerHandle(scoped_ptr<ServiceWorkerHandle> handle); | 47 void RegisterServiceWorkerHandle(scoped_ptr<ServiceWorkerHandle> handle); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 117 |
| 119 bool channel_ready_; // True after BrowserMessageFilter::channel_ != NULL. | 118 bool channel_ready_; // True after BrowserMessageFilter::channel_ != NULL. |
| 120 ScopedVector<IPC::Message> pending_messages_; | 119 ScopedVector<IPC::Message> pending_messages_; |
| 121 | 120 |
| 122 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); | 121 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); |
| 123 }; | 122 }; |
| 124 | 123 |
| 125 } // namespace content | 124 } // namespace content |
| 126 | 125 |
| 127 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 126 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
| OLD | NEW |