| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ |
| 6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ | 6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 void CreateController(const BackgroundFetchRegistrationId& registration_id, | 84 void CreateController(const BackgroundFetchRegistrationId& registration_id, |
| 85 const BackgroundFetchOptions& options); | 85 const BackgroundFetchOptions& options); |
| 86 | 86 |
| 87 // Called when a new registration has been created by the data manager. | 87 // Called when a new registration has been created by the data manager. |
| 88 void DidCreateRegistration( | 88 void DidCreateRegistration( |
| 89 const BackgroundFetchRegistrationId& registration_id, | 89 const BackgroundFetchRegistrationId& registration_id, |
| 90 const BackgroundFetchOptions& options, | 90 const BackgroundFetchOptions& options, |
| 91 const blink::mojom::BackgroundFetchService::FetchCallback& callback, | 91 const blink::mojom::BackgroundFetchService::FetchCallback& callback, |
| 92 blink::mojom::BackgroundFetchError error); | 92 blink::mojom::BackgroundFetchError error); |
| 93 | 93 |
| 94 // Called when a Job Controller has finished processing a Background Fetch | 94 // Called when a the given |controller| has finished processing its job. |
| 95 // registration, as identified by |registration_id|. |aborted_by_developer| | 95 void DidCompleteJob(BackgroundFetchJobController* controller); |
| 96 // will be set to true when it finished at the developer's request. | |
| 97 void DidFinishFetch(const BackgroundFetchRegistrationId& registration_id, | |
| 98 bool aborted_by_developer); | |
| 99 | 96 |
| 100 // |this| is owned by the BrowserContext via the StoragePartitionImpl. | 97 // |this| is owned by the BrowserContext via the StoragePartitionImpl. |
| 101 BrowserContext* browser_context_; | 98 BrowserContext* browser_context_; |
| 102 StoragePartitionImpl* storage_partition_; | 99 StoragePartitionImpl* storage_partition_; |
| 103 | 100 |
| 104 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 101 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
| 105 std::unique_ptr<BackgroundFetchDataManager> background_fetch_data_manager_; | 102 std::unique_ptr<BackgroundFetchDataManager> background_fetch_data_manager_; |
| 106 | 103 |
| 107 // Map of the Background Fetch fetches that are currently in-progress. | 104 // Map of the Background Fetch fetches that are currently in-progress. |
| 108 std::map<BackgroundFetchRegistrationId, | 105 std::map<BackgroundFetchRegistrationId, |
| 109 std::unique_ptr<BackgroundFetchJobController>> | 106 std::unique_ptr<BackgroundFetchJobController>> |
| 110 active_fetches_; | 107 active_fetches_; |
| 111 | 108 |
| 112 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext); | 109 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext); |
| 113 }; | 110 }; |
| 114 | 111 |
| 115 } // namespace content | 112 } // namespace content |
| 116 | 113 |
| 117 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ | 114 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ |
| OLD | NEW |