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

Unified Diff: chrome/browser/component_updater/crx_downloader.cc

Issue 118703008: Merge 241734 "Added support for multiple urls in the component u..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1750/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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/component_updater/crx_downloader.cc
===================================================================
--- chrome/browser/component_updater/crx_downloader.cc (revision 242136)
+++ chrome/browser/component_updater/crx_downloader.cc (working copy)
@@ -74,17 +74,22 @@
return retval;
}
-bool CrxDownloader::StartDownloadFromUrl(const GURL& url) {
+void CrxDownloader::StartDownloadFromUrl(const GURL& url) {
std::vector<GURL> urls;
urls.push_back(url);
- return StartDownload(urls);
+ StartDownload(urls);
}
-bool CrxDownloader::StartDownload(const std::vector<GURL>& urls) {
+void CrxDownloader::StartDownload(const std::vector<GURL>& urls) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- if (urls.empty())
- return false;
+ if (urls.empty()) {
+ // Make a result and complete the download with a generic error for now.
+ Result result;
+ result.error = -1;
+ download_callback_.Run(result);
+ return;
+ }
// If the urls are mutated while this downloader is active, then the
// behavior is undefined in the sense that the outcome of the download could
@@ -94,7 +99,6 @@
current_url_ = urls_.begin();
DoStartDownload(*current_url_);
- return true;
}
void CrxDownloader::OnDownloadComplete(
@@ -128,8 +132,10 @@
// the request over to it so that the successor can try the pruned list
// of urls. Otherwise, the request ends here since the current downloader
// has tried all urls and it can't fall back on any other downloader.
- if (successor_ && successor_->StartDownload(urls_))
+ if (successor_ && !urls_.empty()) {
+ successor_->StartDownload(urls_);
return;
+ }
}
download_callback_.Run(result);
« no previous file with comments | « chrome/browser/component_updater/crx_downloader.h ('k') | chrome/browser/component_updater/crx_update_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698