Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1243)

Side by Side Diff: chrome/browser/component_updater/url_fetcher_downloader.h

Issue 449643002: Componentize component_updater: Move over a bunch of files to the component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix DEPS order Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_URL_FETCHER_DOWNLOADER_H_
6 #define CHROME_BROWSER_COMPONENT_UPDATER_URL_FETCHER_DOWNLOADER_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/threading/thread_checker.h"
12 #include "base/time/time.h"
13 #include "chrome/browser/component_updater/crx_downloader.h"
14 #include "net/url_request/url_fetcher_delegate.h"
15
16 namespace net {
17 class URLFetcher;
18 class URLRequestContextGetter;
19 }
20
21 namespace component_updater {
22
23 // Implements a CRX downloader in top of the URLFetcher.
24 class UrlFetcherDownloader : public CrxDownloader,
25 public net::URLFetcherDelegate {
26 protected:
27 friend class CrxDownloader;
28 UrlFetcherDownloader(scoped_ptr<CrxDownloader> successor,
29 net::URLRequestContextGetter* context_getter,
30 scoped_refptr<base::SequencedTaskRunner> task_runner);
31 virtual ~UrlFetcherDownloader();
32
33 private:
34 // Overrides for CrxDownloader.
35 virtual void DoStartDownload(const GURL& url) OVERRIDE;
36
37 // Overrides for URLFetcherDelegate.
38 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
39 virtual void OnURLFetchDownloadProgress(const net::URLFetcher* source,
40 int64 current,
41 int64 total) OVERRIDE;
42 scoped_ptr<net::URLFetcher> url_fetcher_;
43 net::URLRequestContextGetter* context_getter_;
44 scoped_refptr<base::SequencedTaskRunner> task_runner_;
45
46 base::Time download_start_time_;
47
48 int64 downloaded_bytes_;
49 int64 total_bytes_;
50
51 base::ThreadChecker thread_checker_;
52
53 DISALLOW_COPY_AND_ASSIGN(UrlFetcherDownloader);
54 };
55
56 } // namespace component_updater
57
58 #endif // CHROME_BROWSER_COMPONENT_UPDATER_URL_FETCHER_DOWNLOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698