| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_COMPONENT_UPDATER_CRX_DOWNLOADER_H_ | 5 #ifndef COMPONENTS_UPDATE_CLIENT_CRX_DOWNLOADER_H_ |
| 6 #define COMPONENTS_COMPONENT_UPDATER_CRX_DOWNLOADER_H_ | 6 #define COMPONENTS_UPDATE_CLIENT_CRX_DOWNLOADER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
| 17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class SequencedTaskRunner; | 20 class SequencedTaskRunner; |
| 21 class SingleThreadTaskRunner; | 21 class SingleThreadTaskRunner; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace net { | 24 namespace net { |
| 25 class URLRequestContextGetter; | 25 class URLRequestContextGetter; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace component_updater { | 28 namespace update_client { |
| 29 | 29 |
| 30 // Defines a download interface for downloading components, with retrying on | 30 // Defines a download interface for downloading components, with retrying on |
| 31 // fallback urls in case of errors. This class implements a chain of | 31 // fallback urls in case of errors. This class implements a chain of |
| 32 // responsibility design pattern. It can give successors in the chain a chance | 32 // responsibility design pattern. It can give successors in the chain a chance |
| 33 // to handle a download request, until one of them succeeds, or there are no | 33 // to handle a download request, until one of them succeeds, or there are no |
| 34 // more urls or successors to try. A callback is always called at the end of | 34 // more urls or successors to try. A callback is always called at the end of |
| 35 // the download, one time only. | 35 // the download, one time only. |
| 36 // When multiple urls and downloaders exists, first all the urls are tried, in | 36 // When multiple urls and downloaders exists, first all the urls are tried, in |
| 37 // the order they are provided in the StartDownload function argument. After | 37 // the order they are provided in the StartDownload function argument. After |
| 38 // that, the download request is routed to the next downloader in the chain. | 38 // that, the download request is routed to the next downloader in the chain. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 DownloadCallback download_callback_; | 144 DownloadCallback download_callback_; |
| 145 ProgressCallback progress_callback_; | 145 ProgressCallback progress_callback_; |
| 146 | 146 |
| 147 std::vector<GURL>::iterator current_url_; | 147 std::vector<GURL>::iterator current_url_; |
| 148 | 148 |
| 149 std::vector<DownloadMetrics> download_metrics_; | 149 std::vector<DownloadMetrics> download_metrics_; |
| 150 | 150 |
| 151 DISALLOW_COPY_AND_ASSIGN(CrxDownloader); | 151 DISALLOW_COPY_AND_ASSIGN(CrxDownloader); |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 } // namespace component_updater | 154 } // namespace update_client |
| 155 | 155 |
| 156 #endif // COMPONENTS_COMPONENT_UPDATER_CRX_DOWNLOADER_H_ | 156 #endif // COMPONENTS_UPDATE_CLIENT_CRX_DOWNLOADER_H_ |
| OLD | NEW |