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

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: Created 6 years, 8 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 dbf79252ff3f693ed80c474858f943bf901db11c..2586c64193d9431c9b663fac273801b8afc62da1 100644
--- a/chrome/browser/extensions/installed_loader.cc
+++ b/chrome/browser/extensions/installed_loader.cc
@@ -114,6 +114,23 @@ BackgroundPageType GetBackgroundPageType(const Extension* extension) {
return EVENT_PAGE;
}
+// Records the creation flags of an extension grouped by
+// Extension::InitFromValueFlags.
+void RecordCreationFlags(const Extension* extension) {
+ int highest_flag_bit = 0;
+ for (int i = 1; i < Extension::LAST_INIT_FROM_VALUE_FLAGS; i <<= 1)
benwells 2014/04/22 06:41:44 Nit: add a comment explaining what you're doing he
calamity 2014/04/22 06:56:28 Done.
+ ++highest_flag_bit;
+
+ int flag = 1;
+ for (int i = 1; i <= highest_flag_bit; ++i) {
+ if (extension->creation_flags() & flag) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "Extensions.LoadCreationFlags", i, highest_flag_bit + 1);
+ }
+ flag <<= 1;
+ }
+}
+
} // namespace
InstalledLoader::InstalledLoader(ExtensionService* extension_service)
@@ -403,6 +420,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