| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_REQUEST_COORDINATOR_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_REQUEST_COORDINATOR_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 17 #include "base/supports_user_data.h" | 17 #include "base/supports_user_data.h" |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "base/timer/timer.h" | 19 #include "base/timer/timer.h" |
| 20 #include "components/keyed_service/core/keyed_service.h" | 20 #include "components/keyed_service/core/keyed_service.h" |
| 21 #include "components/offline_pages/background/connection_notifier.h" | 21 #include "components/offline_pages/core/background/connection_notifier.h" |
| 22 #include "components/offline_pages/background/device_conditions.h" | 22 #include "components/offline_pages/core/background/device_conditions.h" |
| 23 #include "components/offline_pages/background/offliner.h" | 23 #include "components/offline_pages/core/background/offliner.h" |
| 24 #include "components/offline_pages/background/request_coordinator_event_logger.h
" | 24 #include "components/offline_pages/core/background/request_coordinator_event_log
ger.h" |
| 25 #include "components/offline_pages/background/request_notifier.h" | 25 #include "components/offline_pages/core/background/request_notifier.h" |
| 26 #include "components/offline_pages/background/request_queue.h" | 26 #include "components/offline_pages/core/background/request_queue.h" |
| 27 #include "components/offline_pages/background/scheduler.h" | 27 #include "components/offline_pages/core/background/scheduler.h" |
| 28 #include "net/nqe/network_quality_estimator.h" | 28 #include "net/nqe/network_quality_estimator.h" |
| 29 #include "url/gurl.h" | 29 #include "url/gurl.h" |
| 30 | 30 |
| 31 namespace offline_pages { | 31 namespace offline_pages { |
| 32 | 32 |
| 33 struct ClientId; | 33 struct ClientId; |
| 34 class OfflinerPolicy; | 34 class OfflinerPolicy; |
| 35 class OfflinerFactory; | 35 class OfflinerFactory; |
| 36 class Offliner; | 36 class Offliner; |
| 37 class RequestQueue; | 37 class RequestQueue; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 OfflinerPolicy* policy() { return policy_.get(); } | 166 OfflinerPolicy* policy() { return policy_.get(); } |
| 167 | 167 |
| 168 ClientPolicyController* GetPolicyController(); | 168 ClientPolicyController* GetPolicyController(); |
| 169 | 169 |
| 170 // Returns the status of the most recent offlining. | 170 // Returns the status of the most recent offlining. |
| 171 Offliner::RequestStatus last_offlining_status() { | 171 Offliner::RequestStatus last_offlining_status() { |
| 172 return last_offlining_status_; | 172 return last_offlining_status_; |
| 173 } | 173 } |
| 174 | 174 |
| 175 bool is_busy() { | 175 bool is_busy() { return is_busy_; } |
| 176 return is_busy_; | |
| 177 } | |
| 178 | 176 |
| 179 // Returns whether processing is starting (before it is decided to actually | 177 // Returns whether processing is starting (before it is decided to actually |
| 180 // process a request (is_busy()) at this time or not. | 178 // process a request (is_busy()) at this time or not. |
| 181 bool is_starting() { return is_starting_; } | 179 bool is_starting() { return is_starting_; } |
| 182 | 180 |
| 183 // Tracks whether the last offlining attempt got canceled. This is reset by | 181 // Tracks whether the last offlining attempt got canceled. This is reset by |
| 184 // the next StartProcessing() call. | 182 // the next StartProcessing() call. |
| 185 bool is_canceled() { | 183 bool is_canceled() { |
| 186 return processing_state_ == ProcessingWindowState::STOPPED; | 184 return processing_state_ == ProcessingWindowState::STOPPED; |
| 187 } | 185 } |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 // Used for potential immediate processing when we get network connection. | 416 // Used for potential immediate processing when we get network connection. |
| 419 std::unique_ptr<ConnectionNotifier> connection_notifier_; | 417 std::unique_ptr<ConnectionNotifier> connection_notifier_; |
| 420 // Allows us to pass a weak pointer to callbacks. | 418 // Allows us to pass a weak pointer to callbacks. |
| 421 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; | 419 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; |
| 422 | 420 |
| 423 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); | 421 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); |
| 424 }; | 422 }; |
| 425 | 423 |
| 426 } // namespace offline_pages | 424 } // namespace offline_pages |
| 427 | 425 |
| 428 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | 426 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_REQUEST_COORDINATOR_H_ |
| OLD | NEW |