OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ | 5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ |
6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ | 6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
206 std::unique_ptr<blink::WebServiceWorkerClientCallbacks>) override; | 206 std::unique_ptr<blink::WebServiceWorkerClientCallbacks>) override; |
207 void Navigate( | 207 void Navigate( |
208 const blink::WebString& uuid, | 208 const blink::WebString& uuid, |
209 const blink::WebURL&, | 209 const blink::WebURL&, |
210 std::unique_ptr<blink::WebServiceWorkerClientCallbacks>) override; | 210 std::unique_ptr<blink::WebServiceWorkerClientCallbacks>) override; |
211 void SkipWaiting(std::unique_ptr<blink::WebServiceWorkerSkipWaitingCallbacks> | 211 void SkipWaiting(std::unique_ptr<blink::WebServiceWorkerSkipWaitingCallbacks> |
212 callbacks) override; | 212 callbacks) override; |
213 void Claim(std::unique_ptr<blink::WebServiceWorkerClientsClaimCallbacks> | 213 void Claim(std::unique_ptr<blink::WebServiceWorkerClientsClaimCallbacks> |
214 callbacks) override; | 214 callbacks) override; |
215 void RegisterForeignFetchScopes( | 215 void RegisterForeignFetchScopes( |
216 int event_id, | |
216 const blink::WebVector<blink::WebURL>& sub_scopes, | 217 const blink::WebVector<blink::WebURL>& sub_scopes, |
217 const blink::WebVector<blink::WebSecurityOrigin>& origins) override; | 218 const blink::WebVector<blink::WebSecurityOrigin>& origins) override; |
218 | 219 |
219 private: | 220 private: |
221 // The key is the unique id of every install event. | |
222 using InstallEventMethodsMap = | |
leonhsl(Using Gerrit)
2017/04/25 06:53:27
Move this declaration into WorkerContextData where
xiaofengzhang
2017/04/25 07:18:15
sorry, I should leave out some changes.
xiaofengzhang
2017/04/25 09:13:32
Done.
| |
223 std::map<int, mojom::ServiceWorkerInstallEventMethodsAssociatedPtr>; | |
224 | |
220 struct WorkerContextData; | 225 struct WorkerContextData; |
221 class NavigationPreloadRequest; | 226 class NavigationPreloadRequest; |
222 | 227 |
223 // Get routing_id for sending message to the ServiceWorkerVersion | 228 // Get routing_id for sending message to the ServiceWorkerVersion |
224 // in the browser process. | 229 // in the browser process. |
225 int GetRoutingID() const { return embedded_worker_id_; } | 230 int GetRoutingID() const { return embedded_worker_id_; } |
226 | 231 |
227 void Send(IPC::Message* message); | 232 void Send(IPC::Message* message); |
228 void SendWorkerStarted(); | 233 void SendWorkerStarted(); |
229 void SetRegistrationInServiceWorkerGlobalScope( | 234 void SetRegistrationInServiceWorkerGlobalScope( |
230 const ServiceWorkerRegistrationObjectInfo& info, | 235 const ServiceWorkerRegistrationObjectInfo& info, |
231 const ServiceWorkerVersionAttributes& attrs); | 236 const ServiceWorkerVersionAttributes& attrs); |
232 | 237 |
233 // mojom::ServiceWorkerEventDispatcher | 238 // mojom::ServiceWorkerEventDispatcher |
239 void DispatchInstallEvent( | |
240 mojom::ServiceWorkerInstallEventMethodsAssociatedPtrInfo client, | |
241 const DispatchInstallEventCallback& callback) override; | |
234 void DispatchActivateEvent( | 242 void DispatchActivateEvent( |
235 const DispatchActivateEventCallback& callback) override; | 243 const DispatchActivateEventCallback& callback) override; |
236 void DispatchBackgroundFetchAbortEvent( | 244 void DispatchBackgroundFetchAbortEvent( |
237 const std::string& tag, | 245 const std::string& tag, |
238 const DispatchBackgroundFetchAbortEventCallback& callback) override; | 246 const DispatchBackgroundFetchAbortEventCallback& callback) override; |
239 void DispatchBackgroundFetchClickEvent( | 247 void DispatchBackgroundFetchClickEvent( |
240 const std::string& tag, | 248 const std::string& tag, |
241 mojom::BackgroundFetchState state, | 249 mojom::BackgroundFetchState state, |
242 const DispatchBackgroundFetchClickEventCallback& callback) override; | 250 const DispatchBackgroundFetchClickEventCallback& callback) override; |
243 void DispatchBackgroundFetchFailEvent( | 251 void DispatchBackgroundFetchFailEvent( |
(...skipping 29 matching lines...) Expand all Loading... | |
273 const std::string& tag, | 281 const std::string& tag, |
274 blink::mojom::BackgroundSyncEventLastChance last_chance, | 282 blink::mojom::BackgroundSyncEventLastChance last_chance, |
275 const DispatchSyncEventCallback& callback) override; | 283 const DispatchSyncEventCallback& callback) override; |
276 void DispatchPaymentRequestEvent( | 284 void DispatchPaymentRequestEvent( |
277 int payment_request_id, | 285 int payment_request_id, |
278 payments::mojom::PaymentAppRequestPtr app_request, | 286 payments::mojom::PaymentAppRequestPtr app_request, |
279 payments::mojom::PaymentAppResponseCallbackPtr response_callback, | 287 payments::mojom::PaymentAppResponseCallbackPtr response_callback, |
280 const DispatchPaymentRequestEventCallback& callback) override; | 288 const DispatchPaymentRequestEventCallback& callback) override; |
281 void Ping(const PingCallback& callback) override; | 289 void Ping(const PingCallback& callback) override; |
282 | 290 |
283 void OnInstallEvent(int request_id); | |
284 void OnNotificationClickEvent( | 291 void OnNotificationClickEvent( |
285 int request_id, | 292 int request_id, |
286 const std::string& notification_id, | 293 const std::string& notification_id, |
287 const PlatformNotificationData& notification_data, | 294 const PlatformNotificationData& notification_data, |
288 int action_index, | 295 int action_index, |
289 const base::NullableString16& reply); | 296 const base::NullableString16& reply); |
290 void OnNotificationCloseEvent( | 297 void OnNotificationCloseEvent( |
291 int request_id, | 298 int request_id, |
292 const std::string& notification_id, | 299 const std::string& notification_id, |
293 const PlatformNotificationData& notification_data); | 300 const PlatformNotificationData& notification_data); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
352 // Initialized on the worker thread in workerContextStarted and | 359 // Initialized on the worker thread in workerContextStarted and |
353 // destructed on the worker thread in willDestroyWorkerContext. | 360 // destructed on the worker thread in willDestroyWorkerContext. |
354 std::unique_ptr<WorkerContextData> context_; | 361 std::unique_ptr<WorkerContextData> context_; |
355 | 362 |
356 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); | 363 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); |
357 }; | 364 }; |
358 | 365 |
359 } // namespace content | 366 } // namespace content |
360 | 367 |
361 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ | 368 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ |
OLD | NEW |