| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 std::vector<scoped_refptr<BackgroundFetchRequestInfo>> initial_requests); | 106 std::vector<scoped_refptr<BackgroundFetchRequestInfo>> initial_requests); |
| 107 | 107 |
| 108 // Called when the given |controller| has finished processing its job. | 108 // Called when the given |controller| has finished processing its job. |
| 109 void DidCompleteJob(BackgroundFetchJobController* controller); | 109 void DidCompleteJob(BackgroundFetchJobController* controller); |
| 110 | 110 |
| 111 // Called when the sequence of settled fetches for |registration_id| have been | 111 // Called when the sequence of settled fetches for |registration_id| have been |
| 112 // retrieved from storage, and the Service Worker event can be invoked. | 112 // retrieved from storage, and the Service Worker event can be invoked. |
| 113 void DidGetSettledFetches( | 113 void DidGetSettledFetches( |
| 114 const BackgroundFetchRegistrationId& registration_id, | 114 const BackgroundFetchRegistrationId& registration_id, |
| 115 blink::mojom::BackgroundFetchError error, | 115 blink::mojom::BackgroundFetchError error, |
| 116 bool background_fetch_succeeded, |
| 116 std::vector<BackgroundFetchSettledFetch> settled_fetches, | 117 std::vector<BackgroundFetchSettledFetch> settled_fetches, |
| 117 std::vector<std::unique_ptr<BlobHandle>> blob_handles); | 118 std::vector<std::unique_ptr<BlobHandle>> blob_handles); |
| 118 | 119 |
| 119 // Called when all processing for the |registration_id| has been finished and | 120 // Called when all processing for the |registration_id| has been finished and |
| 120 // the job, including its associated data, is ready to be deleted. | 121 // the job, including its associated data, is ready to be deleted. |
| 121 void DeleteRegistration( | 122 void DeleteRegistration( |
| 122 const BackgroundFetchRegistrationId& registration_id, | 123 const BackgroundFetchRegistrationId& registration_id, |
| 123 const std::vector<std::unique_ptr<BlobHandle>>& blob_handles); | 124 const std::vector<std::unique_ptr<BlobHandle>>& blob_handles); |
| 124 | 125 |
| 125 // |this| is owned, indirectly, by the BrowserContext. | 126 // |this| is owned, indirectly, by the BrowserContext. |
| 126 BrowserContext* browser_context_; | 127 BrowserContext* browser_context_; |
| 127 | 128 |
| 128 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | 129 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
| 129 | 130 |
| 130 std::unique_ptr<BackgroundFetchDataManager> data_manager_; | 131 std::unique_ptr<BackgroundFetchDataManager> data_manager_; |
| 131 std::unique_ptr<BackgroundFetchEventDispatcher> event_dispatcher_; | 132 std::unique_ptr<BackgroundFetchEventDispatcher> event_dispatcher_; |
| 132 | 133 |
| 133 // Map of the Background Fetch fetches that are currently in-progress. | 134 // Map of the Background Fetch fetches that are currently in-progress. |
| 134 std::map<BackgroundFetchRegistrationId, | 135 std::map<BackgroundFetchRegistrationId, |
| 135 std::unique_ptr<BackgroundFetchJobController>> | 136 std::unique_ptr<BackgroundFetchJobController>> |
| 136 active_fetches_; | 137 active_fetches_; |
| 137 | 138 |
| 138 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext); | 139 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext); |
| 139 }; | 140 }; |
| 140 | 141 |
| 141 } // namespace content | 142 } // namespace content |
| 142 | 143 |
| 143 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ | 144 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ |
| OLD | NEW |