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

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

Issue 8510046: Removing extension name suffix from the metric name in chrome.experimental.metrics (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Removing obsolete comment Created 9 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_metrics_module.cc
diff --git a/chrome/browser/extensions/extension_metrics_module.cc b/chrome/browser/extensions/extension_metrics_module.cc
index 8e3428d1e146b8ba8f8d688a4ca313fff45fad49..4bba31beeea8d67ae24eba44d5668f6a9d5e081b 100644
--- a/chrome/browser/extensions/extension_metrics_module.cc
+++ b/chrome/browser/extensions/extension_metrics_module.cc
@@ -16,23 +16,23 @@ using base::LinearHistogram;
namespace {
-// Build the full name of a metrics for the given extension. Each metric
-// is made up of the unique name within the extension followed by the
-// extension's id. This keeps the metrics from one extension unique from
-// other extensions, as well as those metrics from chrome itself.
+// Build the full name of a metrics for the given extension.
+// For a non-component extension the metric name is made up of the unique name
+// within the extension followed by the extension's id. This keeps the metrics
+// from one extension unique from other extensions, as well as those metrics
+// from chrome itself.
+// For a component extension the metric name is used as is. There are not so
+// many of them and it is easy enough to prevent name clashes.
std::string BuildMetricName(const std::string& name,
const Extension* extension) {
std::string full_name(name);
- full_name += extension->id();
+ if (extension->location() != Extension::COMPONENT)
+ full_name += extension->id();
return full_name;
}
} // anonymous namespace
-// These extension function classes are enabled only if the
-// enable-metrics-extension-api command line switch is used. Refer to
-// extension_function_dispatcher.cc to see how they are enabled.
-
bool MetricsSetEnabledFunction::RunImpl() {
bool enabled = false;
EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &enabled));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698