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

Unified Diff: chrome/browser/extensions/pending_extension_manager.cc

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.cc
diff --git a/chrome/browser/extensions/pending_extension_manager.cc b/chrome/browser/extensions/pending_extension_manager.cc
index ee7759b10229fd1c1c3b6b28818bcef4deae38ab..515f01e3a019d665048fdfb5875701054cef59d4 100644
--- a/chrome/browser/extensions/pending_extension_manager.cc
+++ b/chrome/browser/extensions/pending_extension_manager.cc
@@ -7,6 +7,8 @@
#include <algorithm>
#include "base/logging.h"
+#include "base/metrics/histogram.h"
+#include "base/stl_util.h"
#include "base/version.h"
#include "chrome/common/extensions/extension_constants.h"
#include "content/public/browser/browser_thread.h"
@@ -53,6 +55,13 @@ const PendingExtensionInfo* PendingExtensionManager::GetById(
}
bool PendingExtensionManager::Remove(const std::string& id) {
+ if (base::ContainsKey(expected_policy_reinstalls_, id)) {
+ base::TimeDelta latency =
+ base::TimeTicks::Now() - expected_policy_reinstalls_[id];
+ UMA_HISTOGRAM_LONG_TIMES("Extensions.CorruptPolicyExtensionResolved",
+ latency);
+ expected_policy_reinstalls_.erase(id);
+ }
PendingExtensionList::iterator iter;
for (iter = pending_extension_list_.begin();
iter != pending_extension_list_.end();
@@ -86,6 +95,17 @@ bool PendingExtensionManager::HasPendingExtensionFromSync() const {
return false;
}
+void PendingExtensionManager::ExpectPolicyReinstallForCorruption(
+ const ExtensionId& id) {
+ expected_policy_reinstalls_[id] = base::TimeTicks::Now();
+ UMA_HISTOGRAM_BOOLEAN("Extensions.CorruptPolicyExtensionDetected", true);
+}
+
+bool PendingExtensionManager::IsPolicyReinstallForCorruptionExpected(
+ const ExtensionId& id) const {
+ return base::ContainsKey(expected_policy_reinstalls_, id);
+}
+
bool PendingExtensionManager::AddFromSync(
const std::string& id,
const GURL& update_url,
« no previous file with comments | « chrome/browser/extensions/pending_extension_manager.h ('k') | chrome/browser/extensions/updater/extension_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698