| 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 "ios/chrome/browser/reading_list/reading_list_download_service.h" | 5 #include "ios/chrome/browser/reading_list/reading_list_download_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "ios/chrome/browser/reading_list/reading_list_entry.h" | 12 #include "components/reading_list/reading_list_entry.h" |
| 13 #include "ios/chrome/browser/reading_list/reading_list_model.h" | 13 #include "components/reading_list/reading_list_model.h" |
| 14 #include "ios/web/public/web_thread.h" | 14 #include "ios/web/public/web_thread.h" |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 // Number of time the download must fail before the download occurs only in | 17 // Number of time the download must fail before the download occurs only in |
| 18 // wifi. | 18 // wifi. |
| 19 const int kNumberOfFailsBeforeWifiOnly = 5; | 19 const int kNumberOfFailsBeforeWifiOnly = 5; |
| 20 // Number of time the download must fail before we give up trying to download | 20 // Number of time the download must fail before we give up trying to download |
| 21 // it. | 21 // it. |
| 22 const int kNumberOfFailsBeforeStop = 7; | 22 const int kNumberOfFailsBeforeStop = 7; |
| 23 } // namespace | 23 } // namespace |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 for (auto& url : url_to_download_cellular_) { | 211 for (auto& url : url_to_download_cellular_) { |
| 212 ScheduleDownloadEntryFromURL(url); | 212 ScheduleDownloadEntryFromURL(url); |
| 213 } | 213 } |
| 214 } | 214 } |
| 215 if (type == net::NetworkChangeNotifier::CONNECTION_WIFI) { | 215 if (type == net::NetworkChangeNotifier::CONNECTION_WIFI) { |
| 216 for (auto& url : url_to_download_wifi_) { | 216 for (auto& url : url_to_download_wifi_) { |
| 217 ScheduleDownloadEntryFromURL(url); | 217 ScheduleDownloadEntryFromURL(url); |
| 218 } | 218 } |
| 219 } | 219 } |
| 220 } | 220 } |
| OLD | NEW |