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

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

Issue 2768573002: Send traffic-management headers from extension updater. (Closed)
Patch Set: Rename on_demand_update to foreground_check. Created 3 years, 9 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_updater.cc
diff --git a/chrome/browser/extensions/updater/extension_updater.cc b/chrome/browser/extensions/updater/extension_updater.cc
index 07503e567b6aefa7e2dc361e9f633fc2a0138982..882ebccd21a2e7c54230272acf344c7a7595dec7 100644
--- a/chrome/browser/extensions/updater/extension_updater.cc
+++ b/chrome/browser/extensions/updater/extension_updater.cc
@@ -97,7 +97,7 @@ int CalculateActivePingDays(const Time& last_active_ping_day,
namespace extensions {
ExtensionUpdater::CheckParams::CheckParams()
- : install_immediately(false) {}
+ : install_immediately(false), foreground_check(false) {}
ExtensionUpdater::CheckParams::~CheckParams() {}
@@ -306,7 +306,8 @@ void ExtensionUpdater::DoCheckSoon() {
void ExtensionUpdater::AddToDownloader(
const ExtensionSet* extensions,
const std::list<std::string>& pending_ids,
- int request_id) {
+ int request_id,
+ bool foreground_check) {
InProgressCheck& request = requests_in_progress_[request_id];
for (ExtensionSet::const_iterator extension_iter = extensions->begin();
extension_iter != extensions->end(); ++extension_iter) {
@@ -321,7 +322,7 @@ void ExtensionUpdater::AddToDownloader(
std::list<std::string>::const_iterator pending_id_iter = std::find(
pending_ids.begin(), pending_ids.end(), extension.id());
if (pending_id_iter == pending_ids.end()) {
- if (downloader_->AddExtension(extension, request_id))
+ if (downloader_->AddExtension(extension, request_id, foreground_check))
request.in_progress_ids_.push_back(extension.id());
}
}
@@ -366,18 +367,21 @@ void ExtensionUpdater::CheckNow(const CheckParams& params) {
*iter, info->update_url(),
pending_extension_manager->IsPolicyReinstallForCorruptionExpected(
*iter),
- request_id))
+ request_id, params.foreground_check))
request.in_progress_ids_.push_back(*iter);
}
ExtensionRegistry* registry = ExtensionRegistry::Get(profile_);
- AddToDownloader(&registry->enabled_extensions(), pending_ids, request_id);
- AddToDownloader(&registry->disabled_extensions(), pending_ids, request_id);
+ AddToDownloader(&registry->enabled_extensions(), pending_ids, request_id,
+ params.foreground_check);
+ AddToDownloader(&registry->disabled_extensions(), pending_ids, request_id,
+ params.foreground_check);
} else {
for (std::list<std::string>::const_iterator it = params.ids.begin();
it != params.ids.end(); ++it) {
const Extension* extension = service_->GetExtensionById(*it, true);
- if (extension && downloader_->AddExtension(*extension, request_id))
+ if (extension && downloader_->AddExtension(*extension, request_id,
+ params.foreground_check))
request.in_progress_ids_.push_back(extension->id());
}
}

Powered by Google App Engine
This is Rietveld 408576698