Start transition the metrics library to non-static API. Use gmock in tests.
Review URL: http://codereview.chromium.org/2049007
diff --git a/metrics/metrics_library.cc b/metrics/metrics_library.cc
index 95e78b2..2accb1a 100644
--- a/metrics/metrics_library.cc
+++ b/metrics/metrics_library.cc
@@ -121,6 +121,9 @@
return message_length;
}
+void MetricsLibrary::Init() {
+}
+
// static
bool MetricsLibrary::SendToAutotest(const string& name, int value) {
FILE *autotest_file = fopen(kAutotestPath, "a+");
@@ -151,6 +154,11 @@
return SendMessageToChrome(message_length, message);
}
+bool MetricsLibrary::SendToUMA(const string& name, int sample,
+ int min, int max, int nbuckets) {
+ return SendToChrome(name, sample, min, max, nbuckets);
+}
+
//static
bool MetricsLibrary::SendEnumToChrome(const std::string& name, int sample,
int max) {
@@ -167,3 +175,8 @@
// Send the message.
return SendMessageToChrome(message_length, message);
}
+
+bool MetricsLibrary::SendEnumToUMA(const std::string& name, int sample,
+ int max) {
+ return SendEnumToChrome(name, sample, max);
+}