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_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ | 5 #ifndef CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ |
6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ | 6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 namespace content { | 29 namespace content { |
30 | 30 |
31 class ServiceWorkerMessageFilter; | 31 class ServiceWorkerMessageFilter; |
32 class ServiceWorkerProviderContext; | 32 class ServiceWorkerProviderContext; |
33 class ThreadSafeSender; | 33 class ThreadSafeSender; |
34 class WebServiceWorkerImpl; | 34 class WebServiceWorkerImpl; |
35 class WebServiceWorkerRegistrationImpl; | 35 class WebServiceWorkerRegistrationImpl; |
36 struct ServiceWorkerObjectInfo; | 36 struct ServiceWorkerObjectInfo; |
37 struct ServiceWorkerRegistrationObjectInfo; | 37 struct ServiceWorkerRegistrationObjectInfo; |
38 struct ServiceWorkerVersionAttributes; | 38 struct ServiceWorkerVersionAttributes; |
| 39 struct TransferredMessagePort; |
39 | 40 |
40 // This class manages communication with the browser process about | 41 // This class manages communication with the browser process about |
41 // registration of the service worker, exposed to renderer and worker | 42 // registration of the service worker, exposed to renderer and worker |
42 // scripts through methods like navigator.registerServiceWorker(). | 43 // scripts through methods like navigator.registerServiceWorker(). |
43 class ServiceWorkerDispatcher : public WorkerTaskRunner::Observer { | 44 class ServiceWorkerDispatcher : public WorkerTaskRunner::Observer { |
44 public: | 45 public: |
45 typedef blink::WebServiceWorkerProvider::WebServiceWorkerRegistrationCallbacks | 46 typedef blink::WebServiceWorkerProvider::WebServiceWorkerRegistrationCallbacks |
46 WebServiceWorkerRegistrationCallbacks; | 47 WebServiceWorkerRegistrationCallbacks; |
47 typedef | 48 typedef |
48 blink::WebServiceWorkerProvider::WebServiceWorkerUnregistrationCallbacks | 49 blink::WebServiceWorkerProvider::WebServiceWorkerUnregistrationCallbacks |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 int provider_id, | 194 int provider_id, |
194 int registration_handle_id, | 195 int registration_handle_id, |
195 int changed_mask, | 196 int changed_mask, |
196 const ServiceWorkerVersionAttributes& attributes); | 197 const ServiceWorkerVersionAttributes& attributes); |
197 void OnUpdateFound(int thread_id, | 198 void OnUpdateFound(int thread_id, |
198 const ServiceWorkerRegistrationObjectInfo& info); | 199 const ServiceWorkerRegistrationObjectInfo& info); |
199 void OnSetControllerServiceWorker(int thread_id, | 200 void OnSetControllerServiceWorker(int thread_id, |
200 int provider_id, | 201 int provider_id, |
201 const ServiceWorkerObjectInfo& info, | 202 const ServiceWorkerObjectInfo& info, |
202 bool should_notify_controllerchange); | 203 bool should_notify_controllerchange); |
203 void OnPostMessage(int thread_id, | 204 void OnPostMessage( |
204 int provider_id, | 205 int thread_id, |
205 const base::string16& message, | 206 int provider_id, |
206 const std::vector<int>& sent_message_port_ids, | 207 const base::string16& message, |
207 const std::vector<int>& new_routing_ids); | 208 const std::vector<TransferredMessagePort>& sent_message_ports, |
| 209 const std::vector<int>& new_routing_ids); |
208 | 210 |
209 void SetReadyRegistration( | 211 void SetReadyRegistration( |
210 int provider_id, | 212 int provider_id, |
211 int registration_handle_id); | 213 int registration_handle_id); |
212 | 214 |
213 // Keeps map from handle_id to ServiceWorker object. | 215 // Keeps map from handle_id to ServiceWorker object. |
214 void AddServiceWorker(int handle_id, WebServiceWorkerImpl* worker); | 216 void AddServiceWorker(int handle_id, WebServiceWorkerImpl* worker); |
215 void RemoveServiceWorker(int handle_id); | 217 void RemoveServiceWorker(int handle_id); |
216 | 218 |
217 // Keeps map from registration_handle_id to ServiceWorkerRegistration object. | 219 // Keeps map from registration_handle_id to ServiceWorkerRegistration object. |
(...skipping 22 matching lines...) Expand all Loading... |
240 WorkerToProviderMap worker_to_provider_; | 242 WorkerToProviderMap worker_to_provider_; |
241 | 243 |
242 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 244 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
243 | 245 |
244 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); | 246 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); |
245 }; | 247 }; |
246 | 248 |
247 } // namespace content | 249 } // namespace content |
248 | 250 |
249 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ | 251 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ |
OLD | NEW |