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

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

Issue 412003003: Additional metrics for disabled extensions and content verification (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes from review feedback Created 6 years, 5 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/installed_loader.cc
diff --git a/chrome/browser/extensions/installed_loader.cc b/chrome/browser/extensions/installed_loader.cc
index feb8fe7d4880b0352bbec3d73b1912e964cfeeaa..497eb5d89a199fbcdef3230268fd5700dda3d691 100644
--- a/chrome/browser/extensions/installed_loader.cc
+++ b/chrome/browser/extensions/installed_loader.cc
@@ -134,6 +134,24 @@ void RecordCreationFlags(const Extension* extension) {
}
}
+// Records the disable reasons for a single extension grouped by
+// Extension::DisableReason.
+void RecordDisableReasons(int reasons) {
+ // |reasons| is a bitmask with values from Extension::DisabledReason
+ // which are increasing powers of 2.
+ if (reasons == Extension::DISABLE_NONE) {
+ UMA_HISTOGRAM_ENUMERATION("Extensions.DisableReason",
+ Extension::DISABLE_NONE,
+ Extension::DISABLE_REASON_LAST);
Ilya Sherman 2014/07/24 21:55:51 Please define a small wrapper function around this
asargent_no_longer_on_chrome 2014/07/25 00:09:16 Done.
+ return;
+ }
+ for (int reason = 1; reason < Extension::DISABLE_REASON_LAST; reason <<= 1) {
+ if (reasons & reason)
+ UMA_HISTOGRAM_ENUMERATION(
+ "Extensions.DisableReason", reason, Extension::DISABLE_REASON_LAST);
Ilya Sherman 2014/07/24 21:55:51 UMA_HISTOGRAM_ENUMERATION allocates a vector to ba
asargent_no_longer_on_chrome 2014/07/25 00:09:16 Done.
+ }
+}
+
} // namespace
InstalledLoader::InstalledLoader(ExtensionService* extension_service)
@@ -473,6 +491,7 @@ void InstalledLoader::LoadAllExtensions() {
if (extension_prefs_->DidExtensionEscalatePermissions((*ex)->id())) {
++disabled_for_permissions_count;
}
+ RecordDisableReasons(extension_prefs_->GetDisableReasons((*ex)->id()));
if (Manifest::IsExternalLocation((*ex)->location())) {
// See loop above for ENABLED.
if (ManifestURL::UpdatesFromGallery(*ex)) {
@@ -542,6 +561,8 @@ void InstalledLoader::LoadAllExtensions() {
UMA_HISTOGRAM_COUNTS_100("Extensions.FileAccessNotAllowed",
file_access_not_allowed_count);
}
+ UMA_HISTOGRAM_COUNTS_100("Extensions.CorruptExtensionTotalDisables",
+ extension_prefs_->GetCorruptedDisableCount());
}
int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) {

Powered by Google App Engine
This is Rietveld 408576698