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

Side by Side Diff: components/update_client/url_fetcher_downloader.h

Issue 808773005: Move most of the component updater artifacts to update_client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_UPDATE_CLIENT_URL_FETCHER_DOWNLOADER_H_
6 #define COMPONENTS_UPDATE_CLIENT_URL_FETCHER_DOWNLOADER_H_
7
8 #include <stdint.h>
9
10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/threading/thread_checker.h"
14 #include "base/time/time.h"
15 #include "components/update_client/crx_downloader.h"
16 #include "net/url_request/url_fetcher_delegate.h"
17
18 namespace net {
19 class URLFetcher;
20 class URLRequestContextGetter;
21 }
22
23 namespace update_client {
24
25 // Implements a CRX downloader in top of the URLFetcher.
26 class UrlFetcherDownloader : public CrxDownloader,
27 public net::URLFetcherDelegate {
28 protected:
29 friend class CrxDownloader;
30 UrlFetcherDownloader(scoped_ptr<CrxDownloader> successor,
31 net::URLRequestContextGetter* context_getter,
32 scoped_refptr<base::SequencedTaskRunner> task_runner);
33 ~UrlFetcherDownloader() override;
34
35 private:
36 // Overrides for CrxDownloader.
37 void DoStartDownload(const GURL& url) override;
38
39 // Overrides for URLFetcherDelegate.
40 void OnURLFetchComplete(const net::URLFetcher* source) override;
41 void OnURLFetchDownloadProgress(const net::URLFetcher* source,
42 int64_t current,
43 int64_t total) override;
44 scoped_ptr<net::URLFetcher> url_fetcher_;
45 net::URLRequestContextGetter* context_getter_;
46 scoped_refptr<base::SequencedTaskRunner> task_runner_;
47
48 base::Time download_start_time_;
49
50 int64_t downloaded_bytes_;
51 int64_t total_bytes_;
52
53 base::ThreadChecker thread_checker_;
54
55 DISALLOW_COPY_AND_ASSIGN(UrlFetcherDownloader);
56 };
57
58 } // namespace update_client
59
60 #endif // COMPONENTS_UPDATE_CLIENT_URL_FETCHER_DOWNLOADER_H_
OLDNEW
« no previous file with comments | « components/update_client/update_response.cc ('k') | components/update_client/url_fetcher_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698