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 content { | 19 namespace content { |
20 | 20 |
21 class MessagePortMessageFilter; | 21 class MessagePortMessageFilter; |
| 22 class ResourceContext; |
22 class ServiceWorkerContextCore; | 23 class ServiceWorkerContextCore; |
23 class ServiceWorkerContextWrapper; | 24 class ServiceWorkerContextWrapper; |
24 class ServiceWorkerHandle; | 25 class ServiceWorkerHandle; |
25 class ServiceWorkerProviderHost; | 26 class ServiceWorkerProviderHost; |
26 class ServiceWorkerRegistration; | 27 class ServiceWorkerRegistration; |
27 class ServiceWorkerRegistrationHandle; | 28 class ServiceWorkerRegistrationHandle; |
28 struct ServiceWorkerRegistrationObjectInfo; | 29 struct ServiceWorkerRegistrationObjectInfo; |
29 struct ServiceWorkerVersionAttributes; | 30 struct ServiceWorkerVersionAttributes; |
30 | 31 |
31 class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { | 32 class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { |
32 public: | 33 public: |
33 ServiceWorkerDispatcherHost( | 34 ServiceWorkerDispatcherHost( |
34 int render_process_id, | 35 int render_process_id, |
35 MessagePortMessageFilter* message_port_message_filter); | 36 MessagePortMessageFilter* message_port_message_filter, |
| 37 ResourceContext* resource_context); |
36 | 38 |
37 void Init(ServiceWorkerContextWrapper* context_wrapper); | 39 void Init(ServiceWorkerContextWrapper* context_wrapper); |
38 | 40 |
39 // BrowserMessageFilter implementation | 41 // BrowserMessageFilter implementation |
40 virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; | 42 virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; |
41 virtual void OnDestruct() const OVERRIDE; | 43 virtual void OnDestruct() const OVERRIDE; |
42 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 44 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
43 | 45 |
44 // IPC::Sender implementation | 46 // IPC::Sender implementation |
45 | 47 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 ServiceWorkerStatusCode status); | 153 ServiceWorkerStatusCode status); |
152 | 154 |
153 void SendGetRegistrationError(int thread_id, | 155 void SendGetRegistrationError(int thread_id, |
154 int request_id, | 156 int request_id, |
155 ServiceWorkerStatusCode status); | 157 ServiceWorkerStatusCode status); |
156 | 158 |
157 ServiceWorkerContextCore* GetContext(); | 159 ServiceWorkerContextCore* GetContext(); |
158 | 160 |
159 int render_process_id_; | 161 int render_process_id_; |
160 MessagePortMessageFilter* const message_port_message_filter_; | 162 MessagePortMessageFilter* const message_port_message_filter_; |
| 163 ResourceContext* resource_context_; |
161 scoped_refptr<ServiceWorkerContextWrapper> context_wrapper_; | 164 scoped_refptr<ServiceWorkerContextWrapper> context_wrapper_; |
162 | 165 |
163 IDMap<ServiceWorkerHandle, IDMapOwnPointer> handles_; | 166 IDMap<ServiceWorkerHandle, IDMapOwnPointer> handles_; |
164 IDMap<ServiceWorkerRegistrationHandle, IDMapOwnPointer> registration_handles_; | 167 IDMap<ServiceWorkerRegistrationHandle, IDMapOwnPointer> registration_handles_; |
165 | 168 |
166 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. | 169 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. |
167 ScopedVector<IPC::Message> pending_messages_; | 170 ScopedVector<IPC::Message> pending_messages_; |
168 | 171 |
169 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); | 172 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); |
170 }; | 173 }; |
171 | 174 |
172 } // namespace content | 175 } // namespace content |
173 | 176 |
174 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 177 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
OLD | NEW |