| 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 23 matching lines...) Expand all Loading... |
| 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 struct TransferredMessagePort; |
| 40 | 40 |
| 41 // This class manages communication with the browser process about | 41 // This class manages communication with the browser process about |
| 42 // registration of the service worker, exposed to renderer and worker | 42 // registration of the service worker, exposed to renderer and worker |
| 43 // scripts through methods like navigator.registerServiceWorker(). | 43 // scripts through methods like navigator.registerServiceWorker(). |
| 44 class ServiceWorkerDispatcher : public WorkerTaskRunner::Observer { | 44 class CONTENT_EXPORT ServiceWorkerDispatcher |
| 45 : public WorkerTaskRunner::Observer { |
| 45 public: | 46 public: |
| 46 typedef blink::WebServiceWorkerProvider::WebServiceWorkerRegistrationCallbacks | 47 typedef blink::WebServiceWorkerProvider::WebServiceWorkerRegistrationCallbacks |
| 47 WebServiceWorkerRegistrationCallbacks; | 48 WebServiceWorkerRegistrationCallbacks; |
| 48 typedef | 49 typedef |
| 49 blink::WebServiceWorkerProvider::WebServiceWorkerUnregistrationCallbacks | 50 blink::WebServiceWorkerProvider::WebServiceWorkerUnregistrationCallbacks |
| 50 WebServiceWorkerUnregistrationCallbacks; | 51 WebServiceWorkerUnregistrationCallbacks; |
| 51 typedef | 52 typedef |
| 52 blink::WebServiceWorkerProvider::WebServiceWorkerGetRegistrationCallbacks | 53 blink::WebServiceWorkerProvider::WebServiceWorkerGetRegistrationCallbacks |
| 53 WebServiceWorkerGetRegistrationCallbacks; | 54 WebServiceWorkerGetRegistrationCallbacks; |
| 54 typedef blink::WebServiceWorkerProvider:: | 55 typedef blink::WebServiceWorkerProvider:: |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 IDMapOwnPointer> GetRegistrationForReadyCallbackMap; | 141 IDMapOwnPointer> GetRegistrationForReadyCallbackMap; |
| 141 | 142 |
| 142 typedef std::map<int, blink::WebServiceWorkerProviderClient*> | 143 typedef std::map<int, blink::WebServiceWorkerProviderClient*> |
| 143 ProviderClientMap; | 144 ProviderClientMap; |
| 144 typedef std::map<int, ServiceWorkerProviderContext*> ProviderContextMap; | 145 typedef std::map<int, ServiceWorkerProviderContext*> ProviderContextMap; |
| 145 typedef std::map<int, ServiceWorkerProviderContext*> WorkerToProviderMap; | 146 typedef std::map<int, ServiceWorkerProviderContext*> WorkerToProviderMap; |
| 146 typedef std::map<int, WebServiceWorkerImpl*> WorkerObjectMap; | 147 typedef std::map<int, WebServiceWorkerImpl*> WorkerObjectMap; |
| 147 typedef std::map<int, WebServiceWorkerRegistrationImpl*> | 148 typedef std::map<int, WebServiceWorkerRegistrationImpl*> |
| 148 RegistrationObjectMap; | 149 RegistrationObjectMap; |
| 149 | 150 |
| 151 friend class ServiceWorkerDispatcherTest; |
| 150 friend class WebServiceWorkerImpl; | 152 friend class WebServiceWorkerImpl; |
| 151 friend class WebServiceWorkerRegistrationImpl; | 153 friend class WebServiceWorkerRegistrationImpl; |
| 152 | 154 |
| 153 // WorkerTaskRunner::Observer implementation. | 155 // WorkerTaskRunner::Observer implementation. |
| 154 void OnWorkerRunLoopStopped() override; | 156 void OnWorkerRunLoopStopped() override; |
| 155 | 157 |
| 156 void OnAssociateRegistrationWithServiceWorker( | 158 void OnAssociateRegistrationWithServiceWorker( |
| 157 int thread_id, | 159 int thread_id, |
| 158 int provider_id, | 160 int provider_id, |
| 159 const ServiceWorkerRegistrationObjectInfo& info, | 161 const ServiceWorkerRegistrationObjectInfo& info, |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 WorkerToProviderMap worker_to_provider_; | 252 WorkerToProviderMap worker_to_provider_; |
| 251 | 253 |
| 252 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 254 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 253 | 255 |
| 254 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); | 256 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); |
| 255 }; | 257 }; |
| 256 | 258 |
| 257 } // namespace content | 259 } // namespace content |
| 258 | 260 |
| 259 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ | 261 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ |
| OLD | NEW |