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_JOB_CONTROLLER_H_ | 5 #ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_JOB_CONTROLLER_H_ |
6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_JOB_CONTROLLER_H_ | 6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_JOB_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <unordered_map> | 10 #include <unordered_map> |
(...skipping 30 matching lines...) Expand all Loading... |
41 BackgroundFetchJobController( | 41 BackgroundFetchJobController( |
42 const BackgroundFetchRegistrationId& registration_id, | 42 const BackgroundFetchRegistrationId& registration_id, |
43 const BackgroundFetchOptions& options, | 43 const BackgroundFetchOptions& options, |
44 BackgroundFetchDataManager* data_manager, | 44 BackgroundFetchDataManager* data_manager, |
45 BrowserContext* browser_context, | 45 BrowserContext* browser_context, |
46 scoped_refptr<net::URLRequestContextGetter> request_context, | 46 scoped_refptr<net::URLRequestContextGetter> request_context, |
47 CompletedCallback completed_callback, | 47 CompletedCallback completed_callback, |
48 const net::NetworkTrafficAnnotationTag& traffic_annotation); | 48 const net::NetworkTrafficAnnotationTag& traffic_annotation); |
49 ~BackgroundFetchJobController(); | 49 ~BackgroundFetchJobController(); |
50 | 50 |
51 // Starts fetching the |initial_fetches|. The controller will continue to | 51 // Starts fetching the first few requests. The controller will continue to |
52 // fetch new content until all requests have been handled. | 52 // fetch new content until all requests have been handled. |
53 void Start( | 53 void Start(); |
54 std::vector<scoped_refptr<BackgroundFetchRequestInfo>> initial_requests); | |
55 | 54 |
56 // Updates the representation of this Background Fetch in the user interface | 55 // Updates the representation of this Background Fetch in the user interface |
57 // to match the given |title|. | 56 // to match the given |title|. |
58 void UpdateUI(const std::string& title); | 57 void UpdateUI(const std::string& title); |
59 | 58 |
60 // Immediately aborts this Background Fetch by request of the developer. | 59 // Immediately aborts this Background Fetch by request of the developer. |
61 void Abort(); | 60 void Abort(); |
62 | 61 |
63 // Returns the current state of this Job Controller. | 62 // Returns the current state of this Job Controller. |
64 State state() const { return state_; } | 63 State state() const { return state_; } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 const net::NetworkTrafficAnnotationTag traffic_annotation_; | 115 const net::NetworkTrafficAnnotationTag traffic_annotation_; |
117 | 116 |
118 base::WeakPtrFactory<BackgroundFetchJobController> weak_ptr_factory_; | 117 base::WeakPtrFactory<BackgroundFetchJobController> weak_ptr_factory_; |
119 | 118 |
120 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchJobController); | 119 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchJobController); |
121 }; | 120 }; |
122 | 121 |
123 } // namespace content | 122 } // namespace content |
124 | 123 |
125 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_JOB_CONTROLLER_H_ | 124 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_JOB_CONTROLLER_H_ |
OLD | NEW |