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

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

Issue 2768573002: Send traffic-management headers from extension updater. (Closed)
Patch Set: Change the code according to mek's comments. 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
« no previous file with comments | « extensions/browser/updater/manifest_fetch_data.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5686f6566cfa223890114e8c5eaadb7f2d8f4a1f 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,
+ FetchPriority fetch_priority)
: base_url_(update_url),
full_url_(update_url),
brand_code_(brand_code),
- ping_mode_(ping_mode) {
+ ping_mode_(ping_mode),
+ fetch_priority_(fetch_priority) {
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,
+ FetchPriority fetch_priority) {
if (extension_ids_.find(id) != extension_ids_.end()) {
NOTREACHED() << "Duplicate extension id " << id;
return false;
}
+ if (fetch_priority_ != FOREGROUND) {
+ fetch_priority_ = fetch_priority;
+ }
+
// 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,9 @@ bool ManifestFetchData::DidPing(const std::string& extension_id,
void ManifestFetchData::Merge(const ManifestFetchData& other) {
DCHECK(full_url() == other.full_url());
+ if (fetch_priority_ != FOREGROUND) {
+ fetch_priority_ = other.fetch_priority_;
+ }
request_ids_.insert(other.request_ids_.begin(), other.request_ids_.end());
}
« no previous file with comments | « extensions/browser/updater/manifest_fetch_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698