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

Unified Diff: extensions/browser/updater/manifest_fetch_data.cc

Issue 2768573002: Send traffic-management headers from extension updater. (Closed)
Patch Set: Fix a compiler error in ChromeOS. 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: extensions/browser/updater/manifest_fetch_data.cc
diff --git a/extensions/browser/updater/manifest_fetch_data.cc b/extensions/browser/updater/manifest_fetch_data.cc
index ed7626eaf694527af59b338a03ff49689b43f6d1..7ca8f72caaaefa2c822537bfa21609530a2a2c91 100644
--- a/extensions/browser/updater/manifest_fetch_data.cc
+++ b/extensions/browser/updater/manifest_fetch_data.cc
@@ -41,11 +41,13 @@ ManifestFetchData::ManifestFetchData(const GURL& update_url,
int request_id,
const std::string& brand_code,
const std::string& base_query_params,
- PingMode ping_mode)
+ PingMode ping_mode,
+ bool on_demand_update)
: base_url_(update_url),
full_url_(update_url),
brand_code_(brand_code),
- ping_mode_(ping_mode) {
+ ping_mode_(ping_mode),
+ on_demand_update_(on_demand_update) {
std::string query =
full_url_.has_query() ? full_url_.query() + "&" : std::string();
query += base_query_params;
@@ -85,12 +87,17 @@ bool ManifestFetchData::AddExtension(const std::string& id,
const std::string& version,
const PingData* ping_data,
const std::string& update_url_data,
- const std::string& install_source) {
+ const std::string& install_source,
+ bool on_demand_update) {
if (extension_ids_.find(id) != extension_ids_.end()) {
NOTREACHED() << "Duplicate extension id " << id;
return false;
}
+ if (on_demand_update != on_demand_update_) {
+ return false;
+ }
+
// Compute the string we'd append onto the full_url_, and see if it fits.
std::vector<std::string> parts;
parts.push_back("id=" + id);
@@ -173,6 +180,7 @@ bool ManifestFetchData::DidPing(const std::string& extension_id,
void ManifestFetchData::Merge(const ManifestFetchData& other) {
DCHECK(full_url() == other.full_url());
+ on_demand_update_ |= other.on_demand_update_;
request_ids_.insert(other.request_ids_.begin(), other.request_ids_.end());
}

Powered by Google App Engine
This is Rietveld 408576698