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

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

Issue 240613004: Add UMA logging of extension creation flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add kInitFromValueFlagBits Created 6 years, 7 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
« no previous file with comments | « no previous file | extensions/common/extension.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/installed_loader.cc
diff --git a/chrome/browser/extensions/installed_loader.cc b/chrome/browser/extensions/installed_loader.cc
index 5470083162d4047e6c08175135cd948292f1b101..64118746b9f0cfdd3f6d84a7c8ca7d8170d18fc2 100644
--- a/chrome/browser/extensions/installed_loader.cc
+++ b/chrome/browser/extensions/installed_loader.cc
@@ -115,6 +115,18 @@ BackgroundPageType GetBackgroundPageType(const Extension* extension) {
return EVENT_PAGE;
}
+// Records the creation flags of an extension grouped by
+// Extension::InitFromValueFlags.
+void RecordCreationFlags(const Extension* extension) {
+ for (int i = 0; i < Extension::kInitFromValueFlagBits; ++i) {
+ int flag = 1 << i;
+ if (extension->creation_flags() & flag) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "Extensions.LoadCreationFlags", i, Extension::kInitFromValueFlagBits);
+ }
+ }
+}
+
} // namespace
InstalledLoader::InstalledLoader(ExtensionService* extension_service)
@@ -410,6 +422,8 @@ void InstalledLoader::LoadAllExtensions() {
if (extensions::ManagedModeInfo::IsContentPack(ex->get()))
++content_pack_count;
+ RecordCreationFlags(*ex);
+
extension_service_->RecordPermissionMessagesHistogram(
ex->get(), "Extensions.Permissions_Load");
}
« no previous file with comments | « no previous file | extensions/common/extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698