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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 typedef blink::WebServiceWorkerProvider::WebServiceWorkerRegistrationCallbacks | 45 typedef blink::WebServiceWorkerProvider::WebServiceWorkerRegistrationCallbacks |
46 WebServiceWorkerRegistrationCallbacks; | 46 WebServiceWorkerRegistrationCallbacks; |
47 typedef | 47 typedef |
48 blink::WebServiceWorkerProvider::WebServiceWorkerUnregistrationCallbacks | 48 blink::WebServiceWorkerProvider::WebServiceWorkerUnregistrationCallbacks |
49 WebServiceWorkerUnregistrationCallbacks; | 49 WebServiceWorkerUnregistrationCallbacks; |
50 typedef | 50 typedef |
51 blink::WebServiceWorkerProvider::WebServiceWorkerGetRegistrationCallbacks | 51 blink::WebServiceWorkerProvider::WebServiceWorkerGetRegistrationCallbacks |
52 WebServiceWorkerGetRegistrationCallbacks; | 52 WebServiceWorkerGetRegistrationCallbacks; |
53 | 53 |
54 explicit ServiceWorkerDispatcher(ThreadSafeSender* thread_safe_sender); | 54 explicit ServiceWorkerDispatcher(ThreadSafeSender* thread_safe_sender); |
55 virtual ~ServiceWorkerDispatcher(); | 55 ~ServiceWorkerDispatcher() override; |
56 | 56 |
57 void OnMessageReceived(const IPC::Message& msg); | 57 void OnMessageReceived(const IPC::Message& msg); |
58 bool Send(IPC::Message* msg); | 58 bool Send(IPC::Message* msg); |
59 | 59 |
60 // Corresponds to navigator.serviceWorker.register() | 60 // Corresponds to navigator.serviceWorker.register() |
61 void RegisterServiceWorker( | 61 void RegisterServiceWorker( |
62 int provider_id, | 62 int provider_id, |
63 const GURL& pattern, | 63 const GURL& pattern, |
64 const GURL& script_url, | 64 const GURL& script_url, |
65 WebServiceWorkerRegistrationCallbacks* callbacks); | 65 WebServiceWorkerRegistrationCallbacks* callbacks); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 typedef std::map<int, ServiceWorkerProviderContext*> ProviderContextMap; | 140 typedef std::map<int, ServiceWorkerProviderContext*> ProviderContextMap; |
141 typedef std::map<int, WebServiceWorkerImpl*> WorkerObjectMap; | 141 typedef std::map<int, WebServiceWorkerImpl*> WorkerObjectMap; |
142 typedef std::map<int, ServiceWorkerProviderContext*> WorkerToProviderMap; | 142 typedef std::map<int, ServiceWorkerProviderContext*> WorkerToProviderMap; |
143 typedef std::map<int, WebServiceWorkerRegistrationImpl*> | 143 typedef std::map<int, WebServiceWorkerRegistrationImpl*> |
144 RegistrationObjectMap; | 144 RegistrationObjectMap; |
145 | 145 |
146 friend class WebServiceWorkerImpl; | 146 friend class WebServiceWorkerImpl; |
147 friend class WebServiceWorkerRegistrationImpl; | 147 friend class WebServiceWorkerRegistrationImpl; |
148 | 148 |
149 // WorkerTaskRunner::Observer implementation. | 149 // WorkerTaskRunner::Observer implementation. |
150 virtual void OnWorkerRunLoopStopped() override; | 150 void OnWorkerRunLoopStopped() override; |
151 | 151 |
152 void OnAssociateRegistration(int thread_id, | 152 void OnAssociateRegistration(int thread_id, |
153 int provider_id, | 153 int provider_id, |
154 const ServiceWorkerRegistrationObjectInfo& info, | 154 const ServiceWorkerRegistrationObjectInfo& info, |
155 const ServiceWorkerVersionAttributes& attrs); | 155 const ServiceWorkerVersionAttributes& attrs); |
156 void OnDisassociateRegistration(int thread_id, | 156 void OnDisassociateRegistration(int thread_id, |
157 int provider_id); | 157 int provider_id); |
158 void OnRegistered(int thread_id, | 158 void OnRegistered(int thread_id, |
159 int request_id, | 159 int request_id, |
160 const ServiceWorkerRegistrationObjectInfo& info, | 160 const ServiceWorkerRegistrationObjectInfo& info, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 WorkerToProviderMap worker_to_provider_; | 242 WorkerToProviderMap worker_to_provider_; |
243 | 243 |
244 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 244 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
245 | 245 |
246 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); | 246 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); |
247 }; | 247 }; |
248 | 248 |
249 } // namespace content | 249 } // namespace content |
250 | 250 |
251 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ | 251 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ |
OLD | NEW |