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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 // Unless otherwise noted, all methods are called on the worker thread. | 66 // Unless otherwise noted, all methods are called on the worker thread. |
| 67 class ServiceWorkerContextClient : public blink::WebServiceWorkerContextClient, | 67 class ServiceWorkerContextClient : public blink::WebServiceWorkerContextClient, |
| 68 public mojom::ServiceWorkerEventDispatcher { | 68 public mojom::ServiceWorkerEventDispatcher { |
| 69 public: | 69 public: |
| 70 using SyncCallback = | 70 using SyncCallback = |
| 71 base::Callback<void(ServiceWorkerStatusCode, | 71 base::Callback<void(ServiceWorkerStatusCode, |
| 72 base::Time /* dispatch_event_time */)>; | 72 base::Time /* dispatch_event_time */)>; |
| 73 using FetchCallback = | 73 using FetchCallback = |
| 74 base::Callback<void(ServiceWorkerStatusCode, | 74 base::Callback<void(ServiceWorkerStatusCode, |
| 75 base::Time /* dispatch_event_time */)>; | 75 base::Time /* dispatch_event_time */)>; |
| 76 using PaymentRequestEventCallback = | |
| 77 base::Callback<void(ServiceWorkerStatusCode, | |
| 78 base::Time /* dispatch_event_time */)>; | |
|
falken
2017/04/19 06:56:52
mistaken rebase?
shimazu
2017/04/19 08:32:16
Done.
| |
| 76 | 79 |
| 77 // Returns a thread-specific client instance. This does NOT create a | 80 // Returns a thread-specific client instance. This does NOT create a |
| 78 // new instance. | 81 // new instance. |
| 79 static ServiceWorkerContextClient* ThreadSpecificInstance(); | 82 static ServiceWorkerContextClient* ThreadSpecificInstance(); |
| 80 | 83 |
| 81 // Called on the main thread. | 84 // Called on the main thread. |
| 82 ServiceWorkerContextClient( | 85 ServiceWorkerContextClient( |
| 83 int embedded_worker_id, | 86 int embedded_worker_id, |
| 84 int64_t service_worker_version_id, | 87 int64_t service_worker_version_id, |
| 85 const GURL& service_worker_scope, | 88 const GURL& service_worker_scope, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 void DidHandleBackgroundFetchedEvent(int request_id, | 155 void DidHandleBackgroundFetchedEvent(int request_id, |
| 153 blink::WebServiceWorkerEventResult, | 156 blink::WebServiceWorkerEventResult, |
| 154 double dispatch_event_time) override; | 157 double dispatch_event_time) override; |
| 155 void DidHandleExtendableMessageEvent( | 158 void DidHandleExtendableMessageEvent( |
| 156 int request_id, | 159 int request_id, |
| 157 blink::WebServiceWorkerEventResult result, | 160 blink::WebServiceWorkerEventResult result, |
| 158 double dispatch_event_time) override; | 161 double dispatch_event_time) override; |
| 159 void DidHandleInstallEvent(int request_id, | 162 void DidHandleInstallEvent(int request_id, |
| 160 blink::WebServiceWorkerEventResult result, | 163 blink::WebServiceWorkerEventResult result, |
| 161 double event_dispatch_time) override; | 164 double event_dispatch_time) override; |
| 162 void RespondToFetchEvent(int fetch_event_id, | 165 void RespondToFetchEventWithNoResponse(int fetch_event_id, |
| 163 double event_dispatch_time) override; | 166 double event_dispatch_time) override; |
| 164 void RespondToFetchEvent(int fetch_event_id, | 167 void RespondToFetchEvent(int fetch_event_id, |
| 165 const blink::WebServiceWorkerResponse& response, | 168 const blink::WebServiceWorkerResponse& response, |
| 166 double event_dispatch_time) override; | 169 double event_dispatch_time) override; |
| 170 void RespondToFetchEventWithResponseStream( | |
| 171 int fetch_event_id, | |
| 172 const blink::WebServiceWorkerResponse& response, | |
| 173 blink::WebServiceWorkerStreamHandle* web_body_as_stream, | |
| 174 double event_dispatch_time) override; | |
| 167 void DidHandleFetchEvent(int fetch_event_id, | 175 void DidHandleFetchEvent(int fetch_event_id, |
| 168 blink::WebServiceWorkerEventResult result, | 176 blink::WebServiceWorkerEventResult result, |
| 169 double dispatch_event_time) override; | 177 double dispatch_event_time) override; |
| 170 void DidHandleNotificationClickEvent( | 178 void DidHandleNotificationClickEvent( |
| 171 int request_id, | 179 int request_id, |
| 172 blink::WebServiceWorkerEventResult result, | 180 blink::WebServiceWorkerEventResult result, |
| 173 double dispatch_event_time) override; | 181 double dispatch_event_time) override; |
| 174 void DidHandleNotificationCloseEvent( | 182 void DidHandleNotificationCloseEvent( |
| 175 int request_id, | 183 int request_id, |
| 176 blink::WebServiceWorkerEventResult result, | 184 blink::WebServiceWorkerEventResult result, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 239 const std::string& tag, | 247 const std::string& tag, |
| 240 const std::vector<BackgroundFetchSettledFetch>& fetches, | 248 const std::vector<BackgroundFetchSettledFetch>& fetches, |
| 241 const DispatchBackgroundFetchFailEventCallback& callback) override; | 249 const DispatchBackgroundFetchFailEventCallback& callback) override; |
| 242 void DispatchBackgroundFetchedEvent( | 250 void DispatchBackgroundFetchedEvent( |
| 243 const std::string& tag, | 251 const std::string& tag, |
| 244 const std::vector<BackgroundFetchSettledFetch>& fetches, | 252 const std::vector<BackgroundFetchSettledFetch>& fetches, |
| 245 const DispatchBackgroundFetchedEventCallback& callback) override; | 253 const DispatchBackgroundFetchedEventCallback& callback) override; |
| 246 void DispatchExtendableMessageEvent( | 254 void DispatchExtendableMessageEvent( |
| 247 mojom::ExtendableMessageEventPtr event, | 255 mojom::ExtendableMessageEventPtr event, |
| 248 const DispatchExtendableMessageEventCallback& callback) override; | 256 const DispatchExtendableMessageEventCallback& callback) override; |
| 249 void DispatchFetchEvent(int fetch_event_id, | 257 void DispatchFetchEvent( |
| 250 const ServiceWorkerFetchRequest& request, | 258 int fetch_event_id, |
| 251 mojom::FetchEventPreloadHandlePtr preload_handle, | 259 const ServiceWorkerFetchRequest& request, |
| 252 const DispatchFetchEventCallback& callback) override; | 260 mojom::FetchEventPreloadHandlePtr preload_handle, |
| 261 mojom::ServiceWorkerFetchResponseCallbackPtr response_callback, | |
| 262 const DispatchFetchEventCallback& callback) override; | |
| 253 void DispatchNotificationClickEvent( | 263 void DispatchNotificationClickEvent( |
| 254 const std::string& notification_id, | 264 const std::string& notification_id, |
| 255 const PlatformNotificationData& notification_data, | 265 const PlatformNotificationData& notification_data, |
| 256 int action_index, | 266 int action_index, |
| 257 const base::Optional<base::string16>& reply, | 267 const base::Optional<base::string16>& reply, |
| 258 const DispatchNotificationClickEventCallback& callback) override; | 268 const DispatchNotificationClickEventCallback& callback) override; |
| 259 void DispatchNotificationCloseEvent( | 269 void DispatchNotificationCloseEvent( |
| 260 const std::string& notification_id, | 270 const std::string& notification_id, |
| 261 const PlatformNotificationData& notification_data, | 271 const PlatformNotificationData& notification_data, |
| 262 const DispatchNotificationCloseEventCallback& callback) override; | 272 const DispatchNotificationCloseEventCallback& callback) override; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 345 // Initialized on the worker thread in workerContextStarted and | 355 // Initialized on the worker thread in workerContextStarted and |
| 346 // destructed on the worker thread in willDestroyWorkerContext. | 356 // destructed on the worker thread in willDestroyWorkerContext. |
| 347 std::unique_ptr<WorkerContextData> context_; | 357 std::unique_ptr<WorkerContextData> context_; |
| 348 | 358 |
| 349 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); | 359 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); |
| 350 }; | 360 }; |
| 351 | 361 |
| 352 } // namespace content | 362 } // namespace content |
| 353 | 363 |
| 354 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ | 364 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ |
| OLD | NEW |