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

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

Issue 2299203004: Attempt to repair corrupt enterprise policy force-installed extensions (Closed)
Patch Set: fix chromeos compile problem Created 4 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: 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 5bec4f6d570c6787841d2248ca5b87609a7abf23..986bf1e53b3bfb69dd1394947465d4115e4a2458 100644
--- a/extensions/browser/updater/manifest_fetch_data.cc
+++ b/extensions/browser/updater/manifest_fetch_data.cc
@@ -37,6 +37,9 @@ void AddEnabledStateToPing(std::string* ping_value,
} // namespace
+ManifestFetchData::ExtraParams::ExtraParams()
+ : is_corrupt_policy_reinstall(false) {}
+
ManifestFetchData::ManifestFetchData(const GURL& update_url,
int request_id,
const std::string& brand_code,
@@ -84,8 +87,8 @@ ManifestFetchData::~ManifestFetchData() {
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,
+ const ExtraParams* extra_params) {
if (extension_ids_.find(id) != extension_ids_.end()) {
NOTREACHED() << "Duplicate extension id " << id;
return false;
@@ -99,12 +102,15 @@ bool ManifestFetchData::AddExtension(const std::string& id,
parts.push_back("installsource=" + install_source);
parts.push_back("uc");
- if (!update_url_data.empty()) {
+ if (extra_params && !extra_params->update_url_data.empty()) {
// Make sure the update_url_data string is escaped before using it so that
// there is no chance of overriding the id or v other parameter value
// we place into the x= value.
- parts.push_back("ap=" + net::EscapeQueryParamValue(update_url_data, true));
+ parts.push_back("ap=" + net::EscapeQueryParamValue(
+ extra_params->update_url_data, true));
}
+ if (extra_params && extra_params->is_corrupt_policy_reinstall)
+ parts.push_back("cpr");
lazyboy 2016/09/02 19:21:53 We should update the this function's documentation
asargent_no_longer_on_chrome 2016/09/09 03:30:44 (changes in this file have been reverted, since we
// Append brand code, rollcall and active ping parameters.
if (ping_mode_ != NO_PING) {

Powered by Google App Engine
This is Rietveld 408576698