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

Unified Diff: extensions/browser/updater/extension_downloader.h

Issue 2299203004: Attempt to repair corrupt enterprise policy force-installed extensions (Closed)
Patch Set: switched to using installsource, addressed review comments 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/extension_downloader.h
diff --git a/extensions/browser/updater/extension_downloader.h b/extensions/browser/updater/extension_downloader.h
index 36888ec192df3340e0780b20ea8d7c6a75139441..9165a56dcea42eae8b98d75c9bbd261c04fd5838 100644
--- a/extensions/browser/updater/extension_downloader.h
+++ b/extensions/browser/updater/extension_downloader.h
@@ -80,9 +80,12 @@ class ExtensionDownloader : public net::URLFetcherDelegate,
// In that case, no callbacks will be performed on the |delegate_|.
// The |request_id| is passed on as is to the various |delegate_| callbacks.
// This is used for example by ExtensionUpdater to keep track of when
- // potentially concurrent update checks complete.
+ // potentially concurrent update checks complete. The |is_corrupt_reinstall|
+ // parameter is used to indicate in the request that we detected corruption in
+ // the local copy of the extension and we want to perform a reinstall of it.
bool AddPendingExtension(const std::string& id,
const GURL& update_url,
+ bool is_corrupt_reinstall,
int request_id);
// Schedules a fetch of the manifest of all the extensions added with
@@ -177,12 +180,23 @@ class ExtensionDownloader : public net::URLFetcherDelegate,
int oauth2_attempt_count;
};
+ // Parameters for special cases that aren't used for most requests.
+ struct ExtraParams {
+ // Additional data to be passed up in the update request.
+ std::string update_url_data;
+
+ // Indicates whether this extension is being reinstalled due to corruption.
+ bool is_corrupt_reinstall;
+
+ ExtraParams();
+ };
+
// Helper for AddExtension() and AddPendingExtension().
bool AddExtensionData(const std::string& id,
const base::Version& version,
Manifest::Type extension_type,
const GURL& extension_update_url,
- const std::string& update_url_data,
+ const ExtraParams& extra,
int request_id);
// Adds all recorded stats taken so far to histogram counts.
« no previous file with comments | « chrome/browser/extensions/updater/extension_updater_unittest.cc ('k') | extensions/browser/updater/extension_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698