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

Unified Diff: chrome/browser/extensions/pending_extension_manager.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: chrome/browser/extensions/pending_extension_manager.h
diff --git a/chrome/browser/extensions/pending_extension_manager.h b/chrome/browser/extensions/pending_extension_manager.h
index 627077b14101f00c08861f561567eaf77ec5addb..a103fc1a0e9617efc005e03da678844cd65dd94a 100644
--- a/chrome/browser/extensions/pending_extension_manager.h
+++ b/chrome/browser/extensions/pending_extension_manager.h
@@ -6,11 +6,14 @@
#define CHROME_BROWSER_EXTENSIONS_PENDING_EXTENSION_MANAGER_H_
#include <list>
+#include <map>
#include <string>
#include "base/gtest_prod_util.h"
#include "base/macros.h"
+#include "base/time/time.h"
#include "chrome/browser/extensions/pending_extension_info.h"
+#include "extensions/common/extension_id.h"
#include "extensions/common/manifest.h"
class GURL;
@@ -67,6 +70,13 @@ class PendingExtensionManager {
// Whether there is pending extension install from sync.
bool HasPendingExtensionFromSync() const;
+ // Notifies the manager that we are reinstalling the policy force-installed
+ // extension with |id| because we detected corruption in the current copy.
+ void ExpectPolicyReinstallForCorruption(const ExtensionId& id);
+
+ // Are we expecting a reinstall of the extension with |id| due to corruption?
+ bool IsPolicyReinstallForCorruptionExpected(const ExtensionId& id) const;
+
// Adds an extension in a pending state; the extension with the
// given info will be installed on the next auto-update cycle.
// Return true if the extension was added. Will return false
@@ -140,6 +150,10 @@ class PendingExtensionManager {
PendingExtensionList pending_extension_list_;
+ // A set of policy force-installed extension ids that are being reinstalled
+ // due to corruption, mapped to the time we detected the corruption.
+ std::map<ExtensionId, base::TimeTicks> expected_policy_reinstalls_;
+
FRIEND_TEST_ALL_PREFIXES(::ExtensionServiceTest,
UpdatePendingExtensionAlreadyInstalled);
friend class ExtensionUpdaterTest;
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/pending_extension_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698