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..aae26e3980d2f672137079c1dc43124e38593f89 100644 |
--- a/chrome/browser/extensions/installed_loader.cc |
+++ b/chrome/browser/extensions/installed_loader.cc |
@@ -114,6 +114,25 @@ BackgroundPageType GetBackgroundPageType(const Extension* extension) { |
return EVENT_PAGE; |
} |
+// Records the creation flags of an extension grouped by |
+// Extension::InitFromValueFlags. |
+void RecordCreationFlags(const Extension* extension) { |
+ // Since each flag is a separate bit in an int, this loop is needed to find |
+ // the number of flags. |
+ int highest_flag_bit = 0; |
+ for (int i = 1; i < Extension::LAST_INIT_FROM_VALUE_FLAGS; i <<= 1) |
+ ++highest_flag_bit; |
jar (doing other things)
2014/04/29 16:25:56
I didn't read this section of the code carefully..
calamity
2014/05/12 03:39:10
Done.
|
+ |
+ int flag = 1; |
+ for (int i = 1; i <= highest_flag_bit; ++i) { |
jar (doing other things)
2014/04/29 16:25:56
Since higest_flag_bit == 9, this loop will only re
|
+ if (extension->creation_flags() & flag) { |
jar (doing other things)
2014/04/29 16:25:56
Since you're only looking at 9 choices for |flag|,
|
+ UMA_HISTOGRAM_ENUMERATION( |
+ "Extensions.LoadCreationFlags", i, highest_flag_bit + 1); |
jar (doing other things)
2014/04/29 01:32:25
Other than |i| (which is the sample), the other ar
|
+ } |
+ flag <<= 1; |
+ } |
+} |
+ |
} // namespace |
InstalledLoader::InstalledLoader(ExtensionService* extension_service) |
@@ -403,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"); |
} |