| 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> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 #include "third_party/WebKit/public/platform/modules/background_fetch/background
_fetch.mojom.h" | 16 #include "third_party/WebKit/public/platform/modules/background_fetch/background
_fetch.mojom.h" |
| 17 | 17 |
| 18 namespace net { |
| 19 class URLRequestContextGetter; |
| 20 } |
| 21 |
| 18 namespace url { | 22 namespace url { |
| 19 class Origin; | 23 class Origin; |
| 20 } | 24 } |
| 21 | 25 |
| 22 namespace content { | 26 namespace content { |
| 23 | 27 |
| 24 class BackgroundFetchDataManager; | 28 class BackgroundFetchDataManager; |
| 25 class BackgroundFetchJobController; | 29 class BackgroundFetchJobController; |
| 26 struct BackgroundFetchOptions; | 30 struct BackgroundFetchOptions; |
| 27 class BackgroundFetchRegistrationId; | 31 class BackgroundFetchRegistrationId; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 void DidCreateRegistration( | 96 void DidCreateRegistration( |
| 93 const BackgroundFetchRegistrationId& registration_id, | 97 const BackgroundFetchRegistrationId& registration_id, |
| 94 const BackgroundFetchOptions& options, | 98 const BackgroundFetchOptions& options, |
| 95 const blink::mojom::BackgroundFetchService::FetchCallback& callback, | 99 const blink::mojom::BackgroundFetchService::FetchCallback& callback, |
| 96 blink::mojom::BackgroundFetchError error, | 100 blink::mojom::BackgroundFetchError error, |
| 97 std::vector<BackgroundFetchRequestInfo> initial_requests); | 101 std::vector<BackgroundFetchRequestInfo> initial_requests); |
| 98 | 102 |
| 99 // Called when a the given |controller| has finished processing its job. | 103 // Called when a the given |controller| has finished processing its job. |
| 100 void DidCompleteJob(BackgroundFetchJobController* controller); | 104 void DidCompleteJob(BackgroundFetchJobController* controller); |
| 101 | 105 |
| 102 // |this| is owned by the BrowserContext via the StoragePartitionImpl. | 106 // |this| is owned, indirectly, by the BrowserContext. |
| 103 BrowserContext* browser_context_; | 107 BrowserContext* browser_context_; |
| 104 StoragePartitionImpl* storage_partition_; | |
| 105 DownloadManager* download_manager_; | 108 DownloadManager* download_manager_; |
| 106 | 109 |
| 107 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 110 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
| 111 scoped_refptr<net::URLRequestContextGetter> request_context_; |
| 112 |
| 108 std::unique_ptr<BackgroundFetchDataManager> background_fetch_data_manager_; | 113 std::unique_ptr<BackgroundFetchDataManager> background_fetch_data_manager_; |
| 109 | 114 |
| 110 // Map of the Background Fetch fetches that are currently in-progress. | 115 // Map of the Background Fetch fetches that are currently in-progress. |
| 111 std::map<BackgroundFetchRegistrationId, | 116 std::map<BackgroundFetchRegistrationId, |
| 112 std::unique_ptr<BackgroundFetchJobController>> | 117 std::unique_ptr<BackgroundFetchJobController>> |
| 113 active_fetches_; | 118 active_fetches_; |
| 114 | 119 |
| 115 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext); | 120 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext); |
| 116 }; | 121 }; |
| 117 | 122 |
| 118 } // namespace content | 123 } // namespace content |
| 119 | 124 |
| 120 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ | 125 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ |
| OLD | NEW |