| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 void DidCreateRegistration( | 95 void DidCreateRegistration( |
| 92 const BackgroundFetchRegistrationId& registration_id, | 96 const BackgroundFetchRegistrationId& registration_id, |
| 93 const BackgroundFetchOptions& options, | 97 const BackgroundFetchOptions& options, |
| 94 const blink::mojom::BackgroundFetchService::FetchCallback& callback, | 98 const blink::mojom::BackgroundFetchService::FetchCallback& callback, |
| 95 blink::mojom::BackgroundFetchError error, | 99 blink::mojom::BackgroundFetchError error, |
| 96 std::vector<BackgroundFetchRequestInfo> initial_requests); | 100 std::vector<BackgroundFetchRequestInfo> initial_requests); |
| 97 | 101 |
| 98 // Called when a the given |controller| has finished processing its job. | 102 // Called when a the given |controller| has finished processing its job. |
| 99 void DidCompleteJob(BackgroundFetchJobController* controller); | 103 void DidCompleteJob(BackgroundFetchJobController* controller); |
| 100 | 104 |
| 101 // |this| is owned by the BrowserContext via the StoragePartitionImpl. | 105 // |this| is owned, indirectly, by the BrowserContext. |
| 102 BrowserContext* browser_context_; | 106 BrowserContext* browser_context_; |
| 103 StoragePartitionImpl* storage_partition_; | |
| 104 | 107 |
| 105 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 108 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
| 109 scoped_refptr<net::URLRequestContextGetter> request_context_; |
| 110 |
| 106 std::unique_ptr<BackgroundFetchDataManager> background_fetch_data_manager_; | 111 std::unique_ptr<BackgroundFetchDataManager> background_fetch_data_manager_; |
| 107 | 112 |
| 108 // Map of the Background Fetch fetches that are currently in-progress. | 113 // Map of the Background Fetch fetches that are currently in-progress. |
| 109 std::map<BackgroundFetchRegistrationId, | 114 std::map<BackgroundFetchRegistrationId, |
| 110 std::unique_ptr<BackgroundFetchJobController>> | 115 std::unique_ptr<BackgroundFetchJobController>> |
| 111 active_fetches_; | 116 active_fetches_; |
| 112 | 117 |
| 113 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext); | 118 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext); |
| 114 }; | 119 }; |
| 115 | 120 |
| 116 } // namespace content | 121 } // namespace content |
| 117 | 122 |
| 118 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ | 123 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ |
| OLD | NEW |