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 #include "components/update_client/crx_downloader.h" | 5 #include "components/update_client/crx_downloader.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
11 #include "base/thread_task_runner_handle.h" | 11 #include "base/thread_task_runner_handle.h" |
| 12 #include "build/build_config.h" |
12 #include "components/update_client/url_fetcher_downloader.h" | 13 #include "components/update_client/url_fetcher_downloader.h" |
13 | 14 |
14 #if defined(OS_WIN) | 15 #if defined(OS_WIN) |
15 #include "components/update_client/background_downloader_win.h" | 16 #include "components/update_client/background_downloader_win.h" |
16 #endif | 17 #endif |
17 | 18 |
18 namespace update_client { | 19 namespace update_client { |
19 | 20 |
20 CrxDownloader::Result::Result() | 21 CrxDownloader::Result::Result() |
21 : error(0), downloaded_bytes(-1), total_bytes(-1) { | 22 : error(0), downloaded_bytes(-1), total_bytes(-1) { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 void CrxDownloader::OnDownloadProgress(const Result& result) { | 151 void CrxDownloader::OnDownloadProgress(const Result& result) { |
151 DCHECK(thread_checker_.CalledOnValidThread()); | 152 DCHECK(thread_checker_.CalledOnValidThread()); |
152 | 153 |
153 if (progress_callback_.is_null()) | 154 if (progress_callback_.is_null()) |
154 return; | 155 return; |
155 | 156 |
156 progress_callback_.Run(result); | 157 progress_callback_.Run(result); |
157 } | 158 } |
158 | 159 |
159 } // namespace update_client | 160 } // namespace update_client |
OLD | NEW |