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" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class MessagePortMessageFilter; | 22 class MessagePortMessageFilter; |
23 class ResourceContext; | 23 class ResourceContext; |
24 class ServiceWorkerContextCore; | 24 class ServiceWorkerContextCore; |
25 class ServiceWorkerContextWrapper; | 25 class ServiceWorkerContextWrapper; |
26 class ServiceWorkerHandle; | 26 class ServiceWorkerHandle; |
27 class ServiceWorkerProviderHost; | 27 class ServiceWorkerProviderHost; |
28 class ServiceWorkerRegistration; | 28 class ServiceWorkerRegistration; |
29 class ServiceWorkerRegistrationHandle; | 29 class ServiceWorkerRegistrationHandle; |
30 class ServiceWorkerVersion; | 30 class ServiceWorkerVersion; |
31 struct ServiceWorkerObjectInfo; | 31 struct ServiceWorkerObjectInfo; |
| 32 struct ServiceWorkerRegistrationInfo; |
32 struct ServiceWorkerRegistrationObjectInfo; | 33 struct ServiceWorkerRegistrationObjectInfo; |
33 struct ServiceWorkerVersionAttributes; | 34 struct ServiceWorkerVersionAttributes; |
34 struct TransferredMessagePort; | 35 struct TransferredMessagePort; |
35 | 36 |
36 class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { | 37 class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { |
37 public: | 38 public: |
38 ServiceWorkerDispatcherHost( | 39 ServiceWorkerDispatcherHost( |
39 int render_process_id, | 40 int render_process_id, |
40 MessagePortMessageFilter* message_port_message_filter, | 41 MessagePortMessageFilter* message_port_message_filter, |
41 ResourceContext* resource_context); | 42 ResourceContext* resource_context); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 const GURL& pattern, | 89 const GURL& pattern, |
89 const GURL& script_url); | 90 const GURL& script_url); |
90 void OnUnregisterServiceWorker(int thread_id, | 91 void OnUnregisterServiceWorker(int thread_id, |
91 int request_id, | 92 int request_id, |
92 int provider_id, | 93 int provider_id, |
93 const GURL& pattern); | 94 const GURL& pattern); |
94 void OnGetRegistration(int thread_id, | 95 void OnGetRegistration(int thread_id, |
95 int request_id, | 96 int request_id, |
96 int provider_id, | 97 int provider_id, |
97 const GURL& document_url); | 98 const GURL& document_url); |
| 99 void OnGetRegistrations(int thread_id, int request_id, int provider_id); |
98 void OnGetRegistrationForReady(int thread_id, | 100 void OnGetRegistrationForReady(int thread_id, |
99 int request_id, | 101 int request_id, |
100 int provider_id); | 102 int provider_id); |
101 void OnProviderCreated(int provider_id, | 103 void OnProviderCreated(int provider_id, |
102 int render_frame_id, | 104 int render_frame_id, |
103 ServiceWorkerProviderType provider_type); | 105 ServiceWorkerProviderType provider_type); |
104 void OnProviderDestroyed(int provider_id); | 106 void OnProviderDestroyed(int provider_id); |
105 void OnSetHostedVersionId(int provider_id, int64 version_id); | 107 void OnSetHostedVersionId(int provider_id, int64 version_id); |
106 void OnWorkerReadyForInspection(int embedded_worker_id); | 108 void OnWorkerReadyForInspection(int embedded_worker_id); |
107 void OnWorkerScriptLoaded(int embedded_worker_id, | 109 void OnWorkerScriptLoaded(int embedded_worker_id, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 int request_id, | 155 int request_id, |
154 ServiceWorkerStatusCode status); | 156 ServiceWorkerStatusCode status); |
155 | 157 |
156 void GetRegistrationComplete( | 158 void GetRegistrationComplete( |
157 int thread_id, | 159 int thread_id, |
158 int provider_id, | 160 int provider_id, |
159 int request_id, | 161 int request_id, |
160 ServiceWorkerStatusCode status, | 162 ServiceWorkerStatusCode status, |
161 const scoped_refptr<ServiceWorkerRegistration>& registration); | 163 const scoped_refptr<ServiceWorkerRegistration>& registration); |
162 | 164 |
| 165 void GetRegistrationsComplete( |
| 166 int thread_id, |
| 167 int provider_id, |
| 168 int request_id, |
| 169 const std::vector<scoped_refptr<ServiceWorkerRegistration>>& |
| 170 registrations); |
| 171 |
163 void GetRegistrationForReadyComplete( | 172 void GetRegistrationForReadyComplete( |
164 int thread_id, | 173 int thread_id, |
165 int request_id, | 174 int request_id, |
166 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 175 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
167 ServiceWorkerRegistration* registration); | 176 ServiceWorkerRegistration* registration); |
168 | 177 |
169 void SendRegistrationError(int thread_id, | 178 void SendRegistrationError(int thread_id, |
170 int request_id, | 179 int request_id, |
171 ServiceWorkerStatusCode status, | 180 ServiceWorkerStatusCode status, |
172 const std::string& status_message); | 181 const std::string& status_message); |
173 | 182 |
174 void SendUnregistrationError(int thread_id, | 183 void SendUnregistrationError(int thread_id, |
175 int request_id, | 184 int request_id, |
176 ServiceWorkerStatusCode status); | 185 ServiceWorkerStatusCode status); |
177 | 186 |
178 void SendGetRegistrationError(int thread_id, | 187 void SendGetRegistrationError(int thread_id, |
179 int request_id, | 188 int request_id, |
180 ServiceWorkerStatusCode status); | 189 ServiceWorkerStatusCode status); |
181 | 190 |
| 191 void SendGetRegistrationsError(int thread_id, |
| 192 int request_id, |
| 193 ServiceWorkerStatusCode status); |
| 194 |
182 ServiceWorkerContextCore* GetContext(); | 195 ServiceWorkerContextCore* GetContext(); |
183 | 196 |
184 int render_process_id_; | 197 int render_process_id_; |
185 MessagePortMessageFilter* const message_port_message_filter_; | 198 MessagePortMessageFilter* const message_port_message_filter_; |
186 ResourceContext* resource_context_; | 199 ResourceContext* resource_context_; |
187 scoped_refptr<ServiceWorkerContextWrapper> context_wrapper_; | 200 scoped_refptr<ServiceWorkerContextWrapper> context_wrapper_; |
188 | 201 |
189 IDMap<ServiceWorkerHandle, IDMapOwnPointer> handles_; | 202 IDMap<ServiceWorkerHandle, IDMapOwnPointer> handles_; |
190 IDMap<ServiceWorkerRegistrationHandle, IDMapOwnPointer> registration_handles_; | 203 IDMap<ServiceWorkerRegistrationHandle, IDMapOwnPointer> registration_handles_; |
191 | 204 |
192 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. | 205 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. |
193 ScopedVector<IPC::Message> pending_messages_; | 206 ScopedVector<IPC::Message> pending_messages_; |
194 | 207 |
195 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); | 208 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); |
196 }; | 209 }; |
197 | 210 |
198 } // namespace content | 211 } // namespace content |
199 | 212 |
200 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 213 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
OLD | NEW |