| 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_URL_FETCHER_DOWNLOADER_H_ | 5 #ifndef COMPONENTS_COMPONENT_UPDATER_URL_FETCHER_DOWNLOADER_H_ |
| 6 #define COMPONENTS_COMPONENT_UPDATER_URL_FETCHER_DOWNLOADER_H_ | 6 #define COMPONENTS_COMPONENT_UPDATER_URL_FETCHER_DOWNLOADER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/threading/thread_checker.h" | 13 #include "base/threading/thread_checker.h" |
| 12 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 13 #include "components/component_updater/crx_downloader.h" | 15 #include "components/component_updater/crx_downloader.h" |
| 14 #include "net/url_request/url_fetcher_delegate.h" | 16 #include "net/url_request/url_fetcher_delegate.h" |
| 15 | 17 |
| 16 namespace net { | 18 namespace net { |
| 17 class URLFetcher; | 19 class URLFetcher; |
| 18 class URLRequestContextGetter; | 20 class URLRequestContextGetter; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 30 scoped_refptr<base::SequencedTaskRunner> task_runner); | 32 scoped_refptr<base::SequencedTaskRunner> task_runner); |
| 31 virtual ~UrlFetcherDownloader(); | 33 virtual ~UrlFetcherDownloader(); |
| 32 | 34 |
| 33 private: | 35 private: |
| 34 // Overrides for CrxDownloader. | 36 // Overrides for CrxDownloader. |
| 35 virtual void DoStartDownload(const GURL& url) OVERRIDE; | 37 virtual void DoStartDownload(const GURL& url) OVERRIDE; |
| 36 | 38 |
| 37 // Overrides for URLFetcherDelegate. | 39 // Overrides for URLFetcherDelegate. |
| 38 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 40 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
| 39 virtual void OnURLFetchDownloadProgress(const net::URLFetcher* source, | 41 virtual void OnURLFetchDownloadProgress(const net::URLFetcher* source, |
| 40 int64 current, | 42 int64_t current, |
| 41 int64 total) OVERRIDE; | 43 int64_t total) OVERRIDE; |
| 42 scoped_ptr<net::URLFetcher> url_fetcher_; | 44 scoped_ptr<net::URLFetcher> url_fetcher_; |
| 43 net::URLRequestContextGetter* context_getter_; | 45 net::URLRequestContextGetter* context_getter_; |
| 44 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 46 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| 45 | 47 |
| 46 base::Time download_start_time_; | 48 base::Time download_start_time_; |
| 47 | 49 |
| 48 int64 downloaded_bytes_; | 50 int64_t downloaded_bytes_; |
| 49 int64 total_bytes_; | 51 int64_t total_bytes_; |
| 50 | 52 |
| 51 base::ThreadChecker thread_checker_; | 53 base::ThreadChecker thread_checker_; |
| 52 | 54 |
| 53 DISALLOW_COPY_AND_ASSIGN(UrlFetcherDownloader); | 55 DISALLOW_COPY_AND_ASSIGN(UrlFetcherDownloader); |
| 54 }; | 56 }; |
| 55 | 57 |
| 56 } // namespace component_updater | 58 } // namespace component_updater |
| 57 | 59 |
| 58 #endif // COMPONENTS_COMPONENT_UPDATER_URL_FETCHER_DOWNLOADER_H_ | 60 #endif // COMPONENTS_COMPONENT_UPDATER_URL_FETCHER_DOWNLOADER_H_ |
| OLD | NEW |