| 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/url_fetcher_downloader.h" | 5 #include "components/update_client/url_fetcher_downloader.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 main_task_runner()->PostTask( | 92 main_task_runner()->PostTask( |
| 93 FROM_HERE, | 93 FROM_HERE, |
| 94 base::Bind(&UrlFetcherDownloader::OnDownloadComplete, | 94 base::Bind(&UrlFetcherDownloader::OnDownloadComplete, |
| 95 base::Unretained(this), is_handled, result, download_metrics)); | 95 base::Unretained(this), is_handled, result, download_metrics)); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void UrlFetcherDownloader::OnURLFetchDownloadProgress( | 98 void UrlFetcherDownloader::OnURLFetchDownloadProgress( |
| 99 const net::URLFetcher* source, | 99 const net::URLFetcher* source, |
| 100 int64_t current, | 100 int64_t current, |
| 101 int64_t total) { | 101 int64_t total, |
| 102 int64_t current_network_bytes) { |
| 102 DCHECK(thread_checker_.CalledOnValidThread()); | 103 DCHECK(thread_checker_.CalledOnValidThread()); |
| 103 | 104 |
| 104 downloaded_bytes_ = current; | 105 downloaded_bytes_ = current; |
| 105 total_bytes_ = total; | 106 total_bytes_ = total; |
| 106 | 107 |
| 107 Result result; | 108 Result result; |
| 108 result.downloaded_bytes = downloaded_bytes_; | 109 result.downloaded_bytes = downloaded_bytes_; |
| 109 result.total_bytes = total_bytes_; | 110 result.total_bytes = total_bytes_; |
| 110 | 111 |
| 111 OnDownloadProgress(result); | 112 OnDownloadProgress(result); |
| 112 } | 113 } |
| 113 | 114 |
| 114 } // namespace update_client | 115 } // namespace update_client |
| OLD | NEW |