Chromium Code Reviews| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 void DidHandleBackgroundFetchFailEvent(int request_id, | 149 void DidHandleBackgroundFetchFailEvent(int request_id, |
| 150 blink::WebServiceWorkerEventResult, | 150 blink::WebServiceWorkerEventResult, |
| 151 double dispatch_event_time) override; | 151 double dispatch_event_time) override; |
| 152 void DidHandleBackgroundFetchedEvent(int request_id, | 152 void DidHandleBackgroundFetchedEvent(int request_id, |
| 153 blink::WebServiceWorkerEventResult, | 153 blink::WebServiceWorkerEventResult, |
| 154 double dispatch_event_time) override; | 154 double dispatch_event_time) override; |
| 155 void DidHandleExtendableMessageEvent( | 155 void DidHandleExtendableMessageEvent( |
| 156 int request_id, | 156 int request_id, |
| 157 blink::WebServiceWorkerEventResult result, | 157 blink::WebServiceWorkerEventResult result, |
| 158 double dispatch_event_time) override; | 158 double dispatch_event_time) override; |
| 159 void DidHandleInstallEvent(int request_id, | 159 void DidHandleInstallEvent(int event_id, |
| 160 blink::WebServiceWorkerEventResult result, | 160 blink::WebServiceWorkerEventResult result, |
| 161 double event_dispatch_time) override; | 161 double event_dispatch_time) override; |
| 162 void RespondToFetchEventWithNoResponse(int fetch_event_id, | 162 void RespondToFetchEventWithNoResponse(int fetch_event_id, |
| 163 double event_dispatch_time) override; | 163 double event_dispatch_time) override; |
| 164 void RespondToFetchEvent(int fetch_event_id, | 164 void RespondToFetchEvent(int fetch_event_id, |
| 165 const blink::WebServiceWorkerResponse& response, | 165 const blink::WebServiceWorkerResponse& response, |
| 166 double event_dispatch_time) override; | 166 double event_dispatch_time) override; |
| 167 void RespondToFetchEventWithResponseStream( | 167 void RespondToFetchEventWithResponseStream( |
| 168 int fetch_event_id, | 168 int fetch_event_id, |
| 169 const blink::WebServiceWorkerResponse& response, | 169 const blink::WebServiceWorkerResponse& response, |
| (...skipping 36 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, | |
|
horo
2017/04/27 09:22:21
nit: install_event_id is more understandable.
xiaofengzhang
2017/04/28 07:14:24
Done.
| |
| 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: |
| 220 struct WorkerContextData; | 221 struct WorkerContextData; |
| 221 class NavigationPreloadRequest; | 222 class NavigationPreloadRequest; |
| 222 | 223 |
| 223 // Get routing_id for sending message to the ServiceWorkerVersion | 224 // Get routing_id for sending message to the ServiceWorkerVersion |
| 224 // in the browser process. | 225 // in the browser process. |
| 225 int GetRoutingID() const { return embedded_worker_id_; } | 226 int GetRoutingID() const { return embedded_worker_id_; } |
| 226 | 227 |
| 227 void Send(IPC::Message* message); | 228 void Send(IPC::Message* message); |
| 228 void SendWorkerStarted(); | 229 void SendWorkerStarted(); |
| 229 void SetRegistrationInServiceWorkerGlobalScope( | 230 void SetRegistrationInServiceWorkerGlobalScope( |
| 230 const ServiceWorkerRegistrationObjectInfo& info, | 231 const ServiceWorkerRegistrationObjectInfo& info, |
| 231 const ServiceWorkerVersionAttributes& attrs); | 232 const ServiceWorkerVersionAttributes& attrs); |
| 232 | 233 |
| 233 // mojom::ServiceWorkerEventDispatcher | 234 // mojom::ServiceWorkerEventDispatcher |
| 235 void DispatchInstallEvent( | |
| 236 mojom::ServiceWorkerInstallEventMethodsAssociatedPtrInfo client, | |
| 237 DispatchInstallEventCallback callback) override; | |
| 234 void DispatchActivateEvent(DispatchActivateEventCallback callback) override; | 238 void DispatchActivateEvent(DispatchActivateEventCallback callback) override; |
| 235 void DispatchBackgroundFetchAbortEvent( | 239 void DispatchBackgroundFetchAbortEvent( |
| 236 const std::string& tag, | 240 const std::string& tag, |
| 237 DispatchBackgroundFetchAbortEventCallback callback) override; | 241 DispatchBackgroundFetchAbortEventCallback callback) override; |
| 238 void DispatchBackgroundFetchClickEvent( | 242 void DispatchBackgroundFetchClickEvent( |
| 239 const std::string& tag, | 243 const std::string& tag, |
| 240 mojom::BackgroundFetchState state, | 244 mojom::BackgroundFetchState state, |
| 241 DispatchBackgroundFetchClickEventCallback callback) override; | 245 DispatchBackgroundFetchClickEventCallback callback) override; |
| 242 void DispatchBackgroundFetchFailEvent( | 246 void DispatchBackgroundFetchFailEvent( |
| 243 const std::string& tag, | 247 const std::string& tag, |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 272 const std::string& tag, | 276 const std::string& tag, |
| 273 blink::mojom::BackgroundSyncEventLastChance last_chance, | 277 blink::mojom::BackgroundSyncEventLastChance last_chance, |
| 274 DispatchSyncEventCallback callback) override; | 278 DispatchSyncEventCallback callback) override; |
| 275 void DispatchPaymentRequestEvent( | 279 void DispatchPaymentRequestEvent( |
| 276 int payment_request_id, | 280 int payment_request_id, |
| 277 payments::mojom::PaymentAppRequestPtr app_request, | 281 payments::mojom::PaymentAppRequestPtr app_request, |
| 278 payments::mojom::PaymentAppResponseCallbackPtr response_callback, | 282 payments::mojom::PaymentAppResponseCallbackPtr response_callback, |
| 279 DispatchPaymentRequestEventCallback callback) override; | 283 DispatchPaymentRequestEventCallback callback) override; |
| 280 void Ping(PingCallback callback) override; | 284 void Ping(PingCallback callback) override; |
| 281 | 285 |
| 282 void OnInstallEvent(int request_id); | |
| 283 void OnNotificationClickEvent( | 286 void OnNotificationClickEvent( |
| 284 int request_id, | 287 int request_id, |
| 285 const std::string& notification_id, | 288 const std::string& notification_id, |
| 286 const PlatformNotificationData& notification_data, | 289 const PlatformNotificationData& notification_data, |
| 287 int action_index, | 290 int action_index, |
| 288 const base::NullableString16& reply); | 291 const base::NullableString16& reply); |
| 289 void OnNotificationCloseEvent( | 292 void OnNotificationCloseEvent( |
| 290 int request_id, | 293 int request_id, |
| 291 const std::string& notification_id, | 294 const std::string& notification_id, |
| 292 const PlatformNotificationData& notification_data); | 295 const PlatformNotificationData& notification_data); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 351 // Initialized on the worker thread in workerContextStarted and | 354 // Initialized on the worker thread in workerContextStarted and |
| 352 // destructed on the worker thread in willDestroyWorkerContext. | 355 // destructed on the worker thread in willDestroyWorkerContext. |
| 353 std::unique_ptr<WorkerContextData> context_; | 356 std::unique_ptr<WorkerContextData> context_; |
| 354 | 357 |
| 355 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); | 358 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); |
| 356 }; | 359 }; |
| 357 | 360 |
| 358 } // namespace content | 361 } // namespace content |
| 359 | 362 |
| 360 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ | 363 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ |
| OLD | NEW |