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" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "content/browser/service_worker/service_worker_registration_status.h" | 13 #include "content/browser/service_worker/service_worker_registration_status.h" |
14 #include "content/public/browser/browser_message_filter.h" | 14 #include "content/public/browser/browser_message_filter.h" |
15 | 15 |
16 class GURL; | 16 class GURL; |
17 struct EmbeddedWorkerHostMsg_ReportConsoleMessage_Params; | 17 struct EmbeddedWorkerHostMsg_ReportConsoleMessage_Params; |
18 | 18 |
| 19 namespace net { |
| 20 class URLRequestContext; |
| 21 } |
| 22 |
19 namespace content { | 23 namespace content { |
20 | 24 |
| 25 class ChromeBlobStorageContext; |
21 class MessagePortMessageFilter; | 26 class MessagePortMessageFilter; |
22 class ServiceWorkerContextCore; | 27 class ServiceWorkerContextCore; |
23 class ServiceWorkerContextWrapper; | 28 class ServiceWorkerContextWrapper; |
24 class ServiceWorkerHandle; | 29 class ServiceWorkerHandle; |
25 class ServiceWorkerProviderHost; | 30 class ServiceWorkerProviderHost; |
26 class ServiceWorkerRegistration; | 31 class ServiceWorkerRegistration; |
27 | 32 |
28 class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { | 33 class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { |
29 public: | 34 public: |
30 ServiceWorkerDispatcherHost( | 35 ServiceWorkerDispatcherHost( |
31 int render_process_id, | 36 int render_process_id, |
32 MessagePortMessageFilter* message_port_message_filter); | 37 MessagePortMessageFilter* message_port_message_filter); |
33 | 38 |
34 void Init(ServiceWorkerContextWrapper* context_wrapper); | 39 void Init(ServiceWorkerContextWrapper* context_wrapper, |
| 40 net::URLRequestContext* request_context, |
| 41 ChromeBlobStorageContext* blob_storage); |
35 | 42 |
36 // BrowserMessageFilter implementation | 43 // BrowserMessageFilter implementation |
37 virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; | 44 virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; |
38 virtual void OnDestruct() const OVERRIDE; | 45 virtual void OnDestruct() const OVERRIDE; |
39 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 46 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
40 | 47 |
41 // IPC::Sender implementation | 48 // IPC::Sender implementation |
42 | 49 |
43 // Send() queues the message until the underlying sender is ready. This | 50 // Send() queues the message until the underlying sender is ready. This |
44 // class assumes that Send() can only fail after that when the renderer | 51 // class assumes that Send() can only fail after that when the renderer |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 132 |
126 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. | 133 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. |
127 ScopedVector<IPC::Message> pending_messages_; | 134 ScopedVector<IPC::Message> pending_messages_; |
128 | 135 |
129 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); | 136 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); |
130 }; | 137 }; |
131 | 138 |
132 } // namespace content | 139 } // namespace content |
133 | 140 |
134 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 141 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
OLD | NEW |