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

Unified Diff: chrome/browser/extensions/updater/extension_downloader.cc

Issue 10532037: Revert r139371 and r138961 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/updater/extension_updater_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/updater/extension_downloader.cc
diff --git a/chrome/browser/extensions/updater/extension_downloader.cc b/chrome/browser/extensions/updater/extension_downloader.cc
index b21b1e1d1e46563e49a3d4886b990976d6f2ae19..c9aca17928425e3bcb25ace00eb0dbbef5c8e235 100644
--- a/chrome/browser/extensions/updater/extension_downloader.cc
+++ b/chrome/browser/extensions/updater/extension_downloader.cc
@@ -187,8 +187,7 @@ void ExtensionDownloader::StartBlacklistUpdate(
// url here to avoid DNS hijacking of the blacklist, which is not validated
// by a public key signature like .crx files are.
ManifestFetchData* blacklist_fetch =
- new ManifestFetchData(extension_urls::GetWebstoreUpdateUrl());
- DCHECK(blacklist_fetch->base_url().SchemeIsSecure());
+ new ManifestFetchData(extension_urls::GetWebstoreUpdateUrl(true));
blacklist_fetch->AddExtension(kBlacklistAppID, version, &ping_data, "",
kDefaultInstallSource);
StartUpdateCheck(blacklist_fetch);
@@ -206,11 +205,6 @@ bool ExtensionDownloader::AddExtensionData(const std::string& id,
return false;
}
- // Make sure we use SSL for store-hosted extensions.
- if (extension_urls::IsWebstoreUpdateUrl(update_url) &&
- !update_url.SchemeIsSecure())
- update_url = extension_urls::GetWebstoreUpdateUrl();
-
// Skip extensions with empty IDs.
if (id.empty()) {
LOG(WARNING) << "Found extension with empty ID";
@@ -222,7 +216,9 @@ bool ExtensionDownloader::AddExtensionData(const std::string& id,
} else if (update_url.is_empty()) {
url_stats_.no_url_count++;
// Fill in default update URL.
- update_url = extension_urls::GetWebstoreUpdateUrl();
+ //
+ // TODO(akalin): Figure out if we should use the HTTPS version.
+ update_url = extension_urls::GetWebstoreUpdateUrl(false);
} else {
url_stats_.other_url_count++;
}
@@ -251,7 +247,7 @@ bool ExtensionDownloader::AddExtensionData(const std::string& id,
// webstore update URL.
if (!extension_urls::IsWebstoreUpdateUrl(update_url) &&
MetricsServiceHelper::IsMetricsReportingEnabled()) {
- update_urls.push_back(extension_urls::GetWebstoreUpdateUrl());
+ update_urls.push_back(extension_urls::GetWebstoreUpdateUrl(false));
}
for (size_t i = 0; i < update_urls.size(); ++i) {
@@ -436,27 +432,17 @@ void ExtensionDownloader::HandleManifestResults(
const UpdateManifest::Result* update = &(results->list.at(updates[i]));
const std::string& id = update->extension_id;
not_updated.erase(id);
-
- GURL crx_url = update->crx_url;
if (id != kBlacklistAppID) {
NotifyUpdateFound(update->extension_id);
} else {
// The URL of the blacklist file is returned by the server and we need to
// be sure that we continue to be able to reliably detect whether a URL
// references a blacklist file.
- DCHECK(extension_urls::IsBlacklistUpdateUrl(crx_url)) << crx_url;
-
- // Force https (crbug.com/129587).
- if (!crx_url.SchemeIsSecure()) {
- url_canon::Replacements<char> replacements;
- std::string scheme("https");
- replacements.SetScheme(scheme.c_str(),
- url_parse::Component(0, scheme.size()));
- crx_url = crx_url.ReplaceComponents(replacements);
- }
+ DCHECK(extension_urls::IsBlacklistUpdateUrl(update->crx_url))
+ << update->crx_url;
}
- FetchUpdatedExtension(update->extension_id, crx_url, update->package_hash,
- update->version);
+ FetchUpdatedExtension(update->extension_id, update->crx_url,
+ update->package_hash, update->version);
}
// If the manifest response included a <daystart> element, we want to save
« no previous file with comments | « no previous file | chrome/browser/extensions/updater/extension_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698