| 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_VERSION_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <functional> | 10 #include <functional> |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 // Informs ServiceWorkerVersion that an event has finished being dispatched. | 257 // Informs ServiceWorkerVersion that an event has finished being dispatched. |
| 258 // Returns false if no pending requests with the provided id exist, for | 258 // Returns false if no pending requests with the provided id exist, for |
| 259 // example if the request has already timed out. | 259 // example if the request has already timed out. |
| 260 // Pass the result of the event to |was_handled|, which is used to record | 260 // Pass the result of the event to |was_handled|, which is used to record |
| 261 // statistics based on the event status. | 261 // statistics based on the event status. |
| 262 // TODO(mek): Use something other than a bool for event status. | 262 // TODO(mek): Use something other than a bool for event status. |
| 263 bool FinishRequest(int request_id, | 263 bool FinishRequest(int request_id, |
| 264 bool was_handled, | 264 bool was_handled, |
| 265 base::Time dispatch_event_time); | 265 base::Time dispatch_event_time); |
| 266 | 266 |
| 267 void RegisterForeignFetchScopes(const std::vector<GURL>& sub_scopes, |
| 268 const std::vector<url::Origin>& origins); |
| 269 |
| 267 // Finishes an external request that was started by StartExternalRequest(). | 270 // Finishes an external request that was started by StartExternalRequest(). |
| 268 // Returns false if there was an error finishing the request: e.g. the request | 271 // Returns false if there was an error finishing the request: e.g. the request |
| 269 // was not found or the worker already terminated. | 272 // was not found or the worker already terminated. |
| 270 bool FinishExternalRequest(const std::string& request_uuid); | 273 bool FinishExternalRequest(const std::string& request_uuid); |
| 271 | 274 |
| 272 // Creates a callback that is to be used for marking simple events dispatched | 275 // Creates a callback that is to be used for marking simple events dispatched |
| 273 // through the ServiceWorkerEventDispatcher as finished for the |request_id|. | 276 // through the ServiceWorkerEventDispatcher as finished for the |request_id|. |
| 274 // Simple event means those events expecting a response with only a status | 277 // Simple event means those events expecting a response with only a status |
| 275 // code and the dispatch time. See service_worker_event_dispatcher.mojom. | 278 // code and the dispatch time. See service_worker_event_dispatcher.mojom. |
| 276 SimpleEventCallback CreateSimpleEventCallback(int request_id); | 279 SimpleEventCallback CreateSimpleEventCallback(int request_id); |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 void OnNavigateClientFinished(int request_id, | 612 void OnNavigateClientFinished(int request_id, |
| 610 ServiceWorkerStatusCode status, | 613 ServiceWorkerStatusCode status, |
| 611 const ServiceWorkerClientInfo& client_info); | 614 const ServiceWorkerClientInfo& client_info); |
| 612 void OnSkipWaiting(int request_id); | 615 void OnSkipWaiting(int request_id); |
| 613 void OnClaimClients(int request_id); | 616 void OnClaimClients(int request_id); |
| 614 void OnPongFromWorker(); | 617 void OnPongFromWorker(); |
| 615 | 618 |
| 616 void OnFocusClientFinished(int request_id, | 619 void OnFocusClientFinished(int request_id, |
| 617 const ServiceWorkerClientInfo& client_info); | 620 const ServiceWorkerClientInfo& client_info); |
| 618 | 621 |
| 619 void OnRegisterForeignFetchScopes(const std::vector<GURL>& sub_scopes, | |
| 620 const std::vector<url::Origin>& origins); | |
| 621 | |
| 622 void DidEnsureLiveRegistrationForStartWorker( | 622 void DidEnsureLiveRegistrationForStartWorker( |
| 623 ServiceWorkerMetrics::EventType purpose, | 623 ServiceWorkerMetrics::EventType purpose, |
| 624 Status prestart_status, | 624 Status prestart_status, |
| 625 bool is_browser_startup_complete, | 625 bool is_browser_startup_complete, |
| 626 const StatusCallback& callback, | 626 const StatusCallback& callback, |
| 627 ServiceWorkerStatusCode status, | 627 ServiceWorkerStatusCode status, |
| 628 scoped_refptr<ServiceWorkerRegistration> registration); | 628 scoped_refptr<ServiceWorkerRegistration> registration); |
| 629 void StartWorkerInternal(); | 629 void StartWorkerInternal(); |
| 630 | 630 |
| 631 void DidSkipWaiting(int request_id); | 631 void DidSkipWaiting(int request_id); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 | 835 |
| 836 // At this point |this| can have been deleted, so don't do anything other | 836 // At this point |this| can have been deleted, so don't do anything other |
| 837 // than returning. | 837 // than returning. |
| 838 | 838 |
| 839 return true; | 839 return true; |
| 840 } | 840 } |
| 841 | 841 |
| 842 } // namespace content | 842 } // namespace content |
| 843 | 843 |
| 844 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 844 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| OLD | NEW |