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/component_updater/url_fetcher_downloader.h" | 5 #include "components/update_client/url_fetcher_downloader.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
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 "components/component_updater/component_updater_utils.h" | 11 #include "components/update_client/utils.h" |
12 #include "net/base/load_flags.h" | 12 #include "net/base/load_flags.h" |
13 #include "net/url_request/url_fetcher.h" | 13 #include "net/url_request/url_fetcher.h" |
14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
15 | 15 |
16 namespace component_updater { | 16 namespace update_client { |
17 | 17 |
18 UrlFetcherDownloader::UrlFetcherDownloader( | 18 UrlFetcherDownloader::UrlFetcherDownloader( |
19 scoped_ptr<CrxDownloader> successor, | 19 scoped_ptr<CrxDownloader> successor, |
20 net::URLRequestContextGetter* context_getter, | 20 net::URLRequestContextGetter* context_getter, |
21 scoped_refptr<base::SequencedTaskRunner> task_runner) | 21 scoped_refptr<base::SequencedTaskRunner> task_runner) |
22 : CrxDownloader(successor.Pass()), | 22 : CrxDownloader(successor.Pass()), |
23 context_getter_(context_getter), | 23 context_getter_(context_getter), |
24 task_runner_(task_runner), | 24 task_runner_(task_runner), |
25 downloaded_bytes_(-1), | 25 downloaded_bytes_(-1), |
26 total_bytes_(-1) { | 26 total_bytes_(-1) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 downloaded_bytes_ = current; | 99 downloaded_bytes_ = current; |
100 total_bytes_ = total; | 100 total_bytes_ = total; |
101 | 101 |
102 Result result; | 102 Result result; |
103 result.downloaded_bytes = downloaded_bytes_; | 103 result.downloaded_bytes = downloaded_bytes_; |
104 result.total_bytes = total_bytes_; | 104 result.total_bytes = total_bytes_; |
105 | 105 |
106 OnDownloadProgress(result); | 106 OnDownloadProgress(result); |
107 } | 107 } |
108 | 108 |
109 } // namespace component_updater | 109 } // namespace update_client |
OLD | NEW |