Index: src/platform/metrics/metrics_library.cc |
diff --git a/src/platform/metrics/metrics_library.cc b/src/platform/metrics/metrics_library.cc |
index 681cf96ab597e1cca77906e42887caccc115f6cb..95e78b2275b39515b8f54ef493296098d4af8c6d 100644 |
--- a/src/platform/metrics/metrics_library.cc |
+++ b/src/platform/metrics/metrics_library.cc |
@@ -150,3 +150,20 @@ bool MetricsLibrary::SendToChrome(const string& name, int sample, |
// Send the message. |
return SendMessageToChrome(message_length, message); |
} |
+ |
+//static |
+bool MetricsLibrary::SendEnumToChrome(const std::string& name, int sample, |
+ int max) { |
+ // Format the message. |
+ char message[kBufferSize]; |
+ int32_t message_length = |
+ FormatChromeMessage(kBufferSize, message, |
+ "linearhistogram%c%s %d %d", '\0', |
+ name.c_str(), sample, max); |
+ |
+ if (message_length < 0) |
+ return false; |
+ |
+ // Send the message. |
+ return SendMessageToChrome(message_length, message); |
+} |