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

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

Issue 299853002: Make installed_loader UMA less wasteful. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | chrome/common/extensions/sync_helper.cc » ('j') | extensions/browser/admin_policy.cc » ('J')
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 ab16252f0df436508c00f4ed1db55d1644c44059..e8c557c8a500445c6254198af9206b2f400626a2 100644
--- a/chrome/browser/extensions/installed_loader.cc
+++ b/chrome/browser/extensions/installed_loader.cc
@@ -59,8 +59,9 @@ enum ManifestReloadReason {
// long as existing values are not changed.
enum BackgroundPageType {
NO_BACKGROUND_PAGE = 0,
- BACKGROUND_PAGE_PERSISTENT = 1,
- EVENT_PAGE = 2,
+ BACKGROUND_PAGE_PERSISTENT,
+ EVENT_PAGE,
+ NUM_BACKGROUND_PAGE_TYPES
};
// Used in histogram Extensions.ExternalItemState. Values may be added, as
@@ -223,7 +224,8 @@ void InstalledLoader::LoadAllExtensions() {
ManifestReloadReason reload_reason = ShouldReloadExtensionManifest(*info);
++reload_reason_counts[reload_reason];
UMA_HISTOGRAM_ENUMERATION("Extensions.ManifestReloadEnumValue",
- reload_reason, 100);
+ reload_reason,
+ NUM_MANIFEST_RELOAD_REASONS);
if (reload_reason != NOT_NEEDED) {
// Reloading an extension reads files from disk. We do this on the
@@ -316,13 +318,15 @@ void InstalledLoader::LoadAllExtensions() {
// muck up any of the stats. Later, though, we want to omit component and
// unpacked, as they are less interesting.
if (extension->is_app())
- UMA_HISTOGRAM_ENUMERATION("Extensions.AppLocation", location, 100);
+ UMA_HISTOGRAM_ENUMERATION(
+ "Extensions.AppLocation", location, Manifest::NUM_LOCATIONS);
else if (extension->is_extension())
- UMA_HISTOGRAM_ENUMERATION("Extensions.ExtensionLocation", location, 100);
+ UMA_HISTOGRAM_ENUMERATION(
+ "Extensions.ExtensionLocation", location, Manifest::NUM_LOCATIONS);
if (!ManifestURL::UpdatesFromGallery(extension)) {
UMA_HISTOGRAM_ENUMERATION(
- "Extensions.NonWebstoreLocation", location, 100);
+ "Extensions.NonWebstoreLocation", location, Manifest::NUM_LOCATIONS);
// Check for inconsistencies if the extension was supposedly installed
// from the webstore.
@@ -378,13 +382,14 @@ void InstalledLoader::LoadAllExtensions() {
if (type == Manifest::TYPE_EXTENSION) {
UMA_HISTOGRAM_ENUMERATION("Extensions.BackgroundPageType",
GetBackgroundPageType(extension),
- 10);
+ NUM_BACKGROUND_PAGE_TYPES);
}
// Using an enumeration shows us the total installed ratio across all users.
// Using the totals per user at each startup tells us the distribution of
// usage for each user (e.g. 40% of users have at least one app installed).
- UMA_HISTOGRAM_ENUMERATION("Extensions.LoadType", type, 100);
+ UMA_HISTOGRAM_ENUMERATION(
+ "Extensions.LoadType", type, Manifest::NUM_LOAD_TYPES);
switch (type) {
case Manifest::TYPE_THEME:
++theme_count;
« no previous file with comments | « no previous file | chrome/common/extensions/sync_helper.cc » ('j') | extensions/browser/admin_policy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698