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

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

Issue 516293007: Enable forced extension updates on NaCl arch mismatch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean-up per discussed solution Created 6 years, 3 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/manifest_fetch_data.cc
diff --git a/chrome/browser/extensions/updater/manifest_fetch_data.cc b/chrome/browser/extensions/updater/manifest_fetch_data.cc
index 8ed4fe041fba2b78d0e878857fd2982bbc864d1b..9b417e16f1fc8c0a6e01cbe5542d5a5a916703df 100644
--- a/chrome/browser/extensions/updater/manifest_fetch_data.cc
+++ b/chrome/browser/extensions/updater/manifest_fetch_data.cc
@@ -67,16 +67,25 @@ 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 force_update) {
if (extension_ids_.find(id) != extension_ids_.end()) {
NOTREACHED() << "Duplicate extension id " << id;
return false;
}
+ if (force_update) {
Yoyo Zhou 2014/09/02 19:30:04 nit: no braces
Ken Rockot(use gerrit already) 2014/09/02 20:04:30 Done.
+ forced_updates_.insert(id);
+ }
+
+ // If we want to force an update, we send 0.0.0.0 as the installed version
+ // number.
+ std::string installed_version = force_update ? "0.0.0.0" : version;
Sorin Jianu 2014/09/02 20:06:39 could be made const.
Ken Rockot(use gerrit already) 2014/09/02 20:19:20 Done.
+
// 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);
- parts.push_back("v=" + version);
+ parts.push_back("v=" + installed_version);
if (!install_source.empty())
parts.push_back("installsource=" + install_source);
parts.push_back("uc");
@@ -163,4 +172,8 @@ void ManifestFetchData::Merge(const ManifestFetchData& other) {
request_ids_.insert(other.request_ids_.begin(), other.request_ids_.end());
}
+bool ManifestFetchData::DidForceUpdate(const std::string& extension_id) const {
+ return forced_updates_.find(extension_id) != forced_updates_.end();
+}
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698