Index: chrome/browser/extensions/api/metrics_private/metrics_private_api.cc |
diff --git a/chrome/browser/extensions/api/metrics_private/metrics_private_api.cc b/chrome/browser/extensions/api/metrics_private/metrics_private_api.cc |
index 3265bb45674e5576a22b244c86df0f33357aafa3..13252e41e74148dde50ba15fdd71ddfb2fe186d1 100644 |
--- a/chrome/browser/extensions/api/metrics_private/metrics_private_api.cc |
+++ b/chrome/browser/extensions/api/metrics_private/metrics_private_api.cc |
@@ -8,6 +8,7 @@ |
#include "base/metrics/field_trial.h" |
#include "base/metrics/histogram.h" |
+#include "base/metrics/sparse_histogram.h" |
#include "chrome/browser/metrics/metrics_service.h" |
#include "chrome/common/extensions/api/metrics_private.h" |
#include "components/variations/variations_associated_data.h" |
@@ -22,6 +23,7 @@ namespace GetVariationParams = api::metrics_private::GetVariationParams; |
namespace GetFieldTrial = api::metrics_private::GetFieldTrial; |
namespace RecordUserAction = api::metrics_private::RecordUserAction; |
namespace RecordValue = api::metrics_private::RecordValue; |
+namespace RecordSparseValue = api::metrics_private::RecordSparseValue; |
namespace RecordPercentage = api::metrics_private::RecordPercentage; |
namespace RecordCount = api::metrics_private::RecordCount; |
namespace RecordSmallCount = api::metrics_private::RecordSmallCount; |
@@ -127,6 +129,15 @@ bool MetricsPrivateRecordValueFunction::RunImpl() { |
params->metric.buckets, params->value); |
} |
+bool MetricsPrivateRecordSparseValueFunction::RunImpl() { |
+ scoped_ptr<RecordSparseValue::Params> params( |
+ RecordSparseValue::Params::Create(*args_)); |
+ EXTENSION_FUNCTION_VALIDATE(params.get()); |
+ // This particular UMA_HISTOGRAM_ macro is okay for runtime strings. |
Ilya Sherman
2014/03/27 00:08:16
nit: "runtime strings" -> "non-runtime-constant st
robliao
2014/03/27 00:21:53
Done.
|
+ UMA_HISTOGRAM_SPARSE_SLOWLY(params->metric_name, params->value); |
+ return true; |
+} |
+ |
bool MetricsPrivateRecordPercentageFunction::RunImpl() { |
scoped_ptr<RecordPercentage::Params> params( |
RecordPercentage::Params::Create(*args_)); |