| 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 #include "components/offline_pages/background/request_coordinator.h" | 5 #include "components/offline_pages/background/request_coordinator.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 } | 855 } |
| 856 } | 856 } |
| 857 | 857 |
| 858 bool RequestCoordinator::ShouldTryNextRequest( | 858 bool RequestCoordinator::ShouldTryNextRequest( |
| 859 Offliner::RequestStatus previous_request_status) { | 859 Offliner::RequestStatus previous_request_status) { |
| 860 switch (previous_request_status) { | 860 switch (previous_request_status) { |
| 861 case Offliner::RequestStatus::SAVED: | 861 case Offliner::RequestStatus::SAVED: |
| 862 case Offliner::RequestStatus::SAVE_FAILED: | 862 case Offliner::RequestStatus::SAVE_FAILED: |
| 863 case Offliner::RequestStatus::REQUEST_COORDINATOR_CANCELED: | 863 case Offliner::RequestStatus::REQUEST_COORDINATOR_CANCELED: |
| 864 case Offliner::RequestStatus::REQUEST_COORDINATOR_TIMED_OUT: | 864 case Offliner::RequestStatus::REQUEST_COORDINATOR_TIMED_OUT: |
| 865 case Offliner::RequestStatus::PRERENDERING_FAILED: |
| 865 case Offliner::RequestStatus::PRERENDERING_FAILED_NO_RETRY: | 866 case Offliner::RequestStatus::PRERENDERING_FAILED_NO_RETRY: |
| 866 return true; | 867 return true; |
| 867 case Offliner::RequestStatus::FOREGROUND_CANCELED: | 868 case Offliner::RequestStatus::FOREGROUND_CANCELED: |
| 868 case Offliner::RequestStatus::PRERENDERING_CANCELED: | 869 case Offliner::RequestStatus::PRERENDERING_CANCELED: |
| 869 case Offliner::RequestStatus::PRERENDERING_FAILED: | 870 case Offliner::RequestStatus::PRERENDERING_FAILED_NO_NEXT: |
| 870 // No further processing in this service window. | 871 // No further processing in this service window. |
| 871 return false; | 872 return false; |
| 872 default: | 873 default: |
| 873 // Make explicit choice about new status codes that actually reach here. | 874 // Make explicit choice about new status codes that actually reach here. |
| 874 // Their default is no further processing in this service window. | 875 // Their default is no further processing in this service window. |
| 875 NOTREACHED(); | 876 NOTREACHED(); |
| 876 return false; | 877 return false; |
| 877 } | 878 } |
| 878 } | 879 } |
| 879 | 880 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 | 957 |
| 957 ClientPolicyController* RequestCoordinator::GetPolicyController() { | 958 ClientPolicyController* RequestCoordinator::GetPolicyController() { |
| 958 return policy_controller_.get(); | 959 return policy_controller_.get(); |
| 959 } | 960 } |
| 960 | 961 |
| 961 void RequestCoordinator::Shutdown() { | 962 void RequestCoordinator::Shutdown() { |
| 962 network_quality_estimator_ = nullptr; | 963 network_quality_estimator_ = nullptr; |
| 963 } | 964 } |
| 964 | 965 |
| 965 } // namespace offline_pages | 966 } // namespace offline_pages |
| OLD | NEW |