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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 40 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
41 | 41 |
42 // IPC::Sender implementation | 42 // IPC::Sender implementation |
43 | 43 |
44 // Send() queues the message until the underlying sender is ready. This | 44 // Send() queues the message until the underlying sender is ready. This |
45 // class assumes that Send() can only fail after that when the renderer | 45 // class assumes that Send() can only fail after that when the renderer |
46 // process has terminated, at which point the whole instance will eventually | 46 // process has terminated, at which point the whole instance will eventually |
47 // be destroyed. | 47 // be destroyed. |
48 virtual bool Send(IPC::Message* message) OVERRIDE; | 48 virtual bool Send(IPC::Message* message) OVERRIDE; |
49 | 49 |
| 50 // Returns the existing registration handle whose reference count is |
| 51 // incremented or newly created one if it doesn't exist. |
| 52 ServiceWorkerRegistrationHandle* GetOrCreateRegistrationHandle( |
| 53 int provider_id, |
| 54 ServiceWorkerRegistration* registration); |
| 55 |
50 void RegisterServiceWorkerHandle(scoped_ptr<ServiceWorkerHandle> handle); | 56 void RegisterServiceWorkerHandle(scoped_ptr<ServiceWorkerHandle> handle); |
51 void RegisterServiceWorkerRegistrationHandle( | 57 void RegisterServiceWorkerRegistrationHandle( |
52 scoped_ptr<ServiceWorkerRegistrationHandle> handle); | 58 scoped_ptr<ServiceWorkerRegistrationHandle> handle); |
53 | 59 |
54 MessagePortMessageFilter* message_port_message_filter() { | 60 MessagePortMessageFilter* message_port_message_filter() { |
55 return message_port_message_filter_; | 61 return message_port_message_filter_; |
56 } | 62 } |
57 | 63 |
58 protected: | 64 protected: |
59 virtual ~ServiceWorkerDispatcherHost(); | 65 virtual ~ServiceWorkerDispatcherHost(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 143 |
138 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. | 144 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. |
139 ScopedVector<IPC::Message> pending_messages_; | 145 ScopedVector<IPC::Message> pending_messages_; |
140 | 146 |
141 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); | 147 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); |
142 }; | 148 }; |
143 | 149 |
144 } // namespace content | 150 } // namespace content |
145 | 151 |
146 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 152 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
OLD | NEW |