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

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

Issue 476073002: Revert of Factor Chrome details out of update manifest fetching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
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 1296662e225b9766d9fc1082bc65d892751b5655..58463804bf8bb59cd53896c90f08f51b61e769b3 100644
--- a/chrome/browser/extensions/updater/extension_downloader.cc
+++ b/chrome/browser/extensions/updater/extension_downloader.cc
@@ -187,8 +187,7 @@
extensions_queue_(&kDefaultBackoffPolicy,
base::Bind(&ExtensionDownloader::CreateExtensionFetcher,
base::Unretained(this))),
- extension_cache_(NULL),
- enable_extra_update_metrics_(false) {
+ extension_cache_(NULL) {
DCHECK(delegate_);
DCHECK(request_context_);
}
@@ -266,8 +265,9 @@
// Note: it is very important that we use the https version of the update
// url here to avoid DNS hijacking of the blacklist, which is not validated
// by a public key signature like .crx files are.
- scoped_ptr<ManifestFetchData> blacklist_fetch(CreateManifestFetchData(
- extension_urls::GetWebstoreUpdateUrl(), request_id));
+ scoped_ptr<ManifestFetchData> blacklist_fetch(
+ new ManifestFetchData(extension_urls::GetWebstoreUpdateUrl(),
+ request_id));
DCHECK(blacklist_fetch->base_url().SchemeIsSecure());
blacklist_fetch->AddExtension(kBlacklistAppID,
version,
@@ -340,10 +340,10 @@
std::vector<GURL> update_urls;
update_urls.push_back(update_url);
- // If metrics are enabled, also add to ManifestFetchData for the
+ // If UMA is enabled, also add to ManifestFetchData for the
// webstore update URL.
if (!extension_urls::IsWebstoreUpdateUrl(update_url) &&
- enable_extra_update_metrics_) {
+ ChromeMetricsServiceAccessor::IsMetricsReportingEnabled()) {
update_urls.push_back(extension_urls::GetWebstoreUpdateUrl());
}
@@ -377,7 +377,7 @@
// Otherwise add a new element to the list, if the list doesn't exist or
// if its last element is already full.
linked_ptr<ManifestFetchData> fetch(
- CreateManifestFetchData(update_urls[i], request_id));
+ new ManifestFetchData(update_urls[i], request_id));
fetches_preparing_[std::make_pair(request_id, update_urls[i])].
push_back(fetch);
added = fetch->AddExtension(id, version.GetString(),
@@ -928,19 +928,4 @@
extension_fetcher_->Start();
}
-ManifestFetchData* ExtensionDownloader::CreateManifestFetchData(
- const GURL& update_url,
- int request_id) {
- ManifestFetchData::PingMode ping_mode = ManifestFetchData::NO_PING;
- if (update_url.DomainIs(ping_enabled_domain_.c_str())) {
- if (enable_extra_update_metrics_) {
- ping_mode = ManifestFetchData::PING_WITH_METRICS;
- } else {
- ping_mode = ManifestFetchData::PING;
- }
- }
- return new ManifestFetchData(
- update_url, request_id, brand_code_, manifest_query_params_, ping_mode);
-}
-
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698