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

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

Issue 101043010: Added support for multiple urls in the component updater. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 CHROME_BROWSER_COMPONENT_UPDATER_CRX_DOWNLOADER_H_ 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_CRX_DOWNLOADER_H_
6 #define CHROME_BROWSER_COMPONENT_UPDATER_CRX_DOWNLOADER_H_ 6 #define CHROME_BROWSER_COMPONENT_UPDATER_CRX_DOWNLOADER_H_
7 7
8 #include <vector> 8 #include <vector>
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // chain of responsibility. |is_background_download| specifies that a 75 // chain of responsibility. |is_background_download| specifies that a
76 // background downloader be used, if the platform supports it. 76 // background downloader be used, if the platform supports it.
77 static CrxDownloader* Create( 77 static CrxDownloader* Create(
78 bool is_background_download, 78 bool is_background_download,
79 net::URLRequestContextGetter* context_getter, 79 net::URLRequestContextGetter* context_getter,
80 scoped_refptr<base::SequencedTaskRunner> task_runner, 80 scoped_refptr<base::SequencedTaskRunner> task_runner,
81 const DownloadCallback& download_callback); 81 const DownloadCallback& download_callback);
82 virtual ~CrxDownloader(); 82 virtual ~CrxDownloader();
83 83
84 // Starts the download. One instance of the class handles one download only. 84 // Starts the download. One instance of the class handles one download only.
85 // Returns true if success or false in case of errors. One instance of 85 // One instance of CrxDownloader can only be started once, otherwise the
86 // CrxDownloader can only be started once, otherwise the behavior is 86 // behavior is undefined. The callback gets invoked if the download can't
87 // undefined. 87 // be started.
88 bool StartDownloadFromUrl(const GURL& url); 88 void StartDownloadFromUrl(const GURL& url);
89 bool StartDownload(const std::vector<GURL>& urls); 89 void StartDownload(const std::vector<GURL>& urls);
90 90
91 const std::vector<DownloadMetrics> download_metrics() const; 91 const std::vector<DownloadMetrics> download_metrics() const;
92 92
93 protected: 93 protected:
94 CrxDownloader(scoped_ptr<CrxDownloader> successor, 94 CrxDownloader(scoped_ptr<CrxDownloader> successor,
95 const DownloadCallback& download_callback); 95 const DownloadCallback& download_callback);
96 96
97 // Handles the fallback in the case of multiple urls and routing of the 97 // Handles the fallback in the case of multiple urls and routing of the
98 // download to the following successor in the chain. Derived classes must call 98 // download to the following successor in the chain. Derived classes must call
99 // this function after each attempt at downloading the urls provided 99 // this function after each attempt at downloading the urls provided
(...skipping 20 matching lines...) Expand all
120 120
121 std::vector<DownloadMetrics> download_metrics_; 121 std::vector<DownloadMetrics> download_metrics_;
122 122
123 DISALLOW_COPY_AND_ASSIGN(CrxDownloader); 123 DISALLOW_COPY_AND_ASSIGN(CrxDownloader);
124 }; 124 };
125 125
126 } // namespace component_updater 126 } // namespace component_updater
127 127
128 #endif // CHROME_BROWSER_COMPONENT_UPDATER_CRX_DOWNLOADER_H_ 128 #endif // CHROME_BROWSER_COMPONENT_UPDATER_CRX_DOWNLOADER_H_
129 129
OLDNEW
« no previous file with comments | « chrome/browser/component_updater/component_updater_utils.cc ('k') | chrome/browser/component_updater/crx_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698