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

Unified Diff: metrics_library.cc

Issue 6094010: Add support for user actions to the metrics library and the metrics clients. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/metrics.git@master
Patch Set: Created 9 years, 11 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 | « metrics_library.h ('k') | metrics_library_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: metrics_library.cc
diff --git a/metrics_library.cc b/metrics_library.cc
index f720972c22f16b9385dd81c14555d3bd7ce88918..05e63acff5fd32861647adeefd80b450050863b1 100644
--- a/metrics_library.cc
+++ b/metrics_library.cc
@@ -221,7 +221,6 @@ bool MetricsLibrary::SendToUMA(const string& name, int sample,
FormatChromeMessage(kBufferSize, message,
"histogram%c%s %d %d %d %d", '\0',
name.c_str(), sample, min, max, nbuckets);
-
if (message_length < 0)
return false;
@@ -237,7 +236,19 @@ bool MetricsLibrary::SendEnumToUMA(const std::string& name, int sample,
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);
+}
+
+bool MetricsLibrary::SendUserActionToUMA(const std::string& action) {
+ // Format the message.
+ char message[kBufferSize];
+ int32_t message_length =
+ FormatChromeMessage(kBufferSize, message,
+ "useraction%c%s", '\0', action.c_str());
if (message_length < 0)
return false;
« no previous file with comments | « metrics_library.h ('k') | metrics_library_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698