summaryrefslogtreecommitdiffstats
path: root/content/public/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'content/public/renderer')
-rw-r--r--content/public/renderer/render_thread.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/content/public/renderer/render_thread.h b/content/public/renderer/render_thread.h
index 23ca0af..4693da3 100644
--- a/content/public/renderer/render_thread.h
+++ b/content/public/renderer/render_thread.h
@@ -9,6 +9,7 @@
#include "base/callback.h"
#include "base/memory/shared_memory.h"
#include "content/common/content_export.h"
+#include "content/public/common/user_metrics_action.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_sender.h"
@@ -78,8 +79,22 @@ class CONTENT_EXPORT RenderThread : public IPC::Sender {
// initialization.
virtual void EnsureWebKitInitialized() = 0;
- // Helper function to send over a string to be recorded by user metrics
- virtual void RecordUserMetrics(const std::string& action) = 0;
+ // Sends over a UserMetricsAction to be recorded by user metrics as an action.
+ // Once a new user metric is added, run
+ // tools/metrics/actions/extract_actions.py --hash
+ // to generate a new mapping of [action hashes -> metric names] and send it
+ // out for review to be updated.
+ // WARNING: When using UserMetricsAction, UserMetricsAction and a string
+ // literal parameter must be on the same line, e.g.
+ // RenderThread::Get()->RecordAction(
+ // UserMetricsAction("my extremely long action name"));
+ // because otherwise our processing scripts won't pick up on new actions.
+ virtual void RecordAction(const UserMetricsAction& action) = 0;
+
+ // Sends over a string to be recorded by user metrics as a computed action.
+ // When you use this you need to also update the rules for extracting known
+ // actions in chrome/tools/extract_actions.py.
+ virtual void RecordComputedAction(const std::string& action) = 0;
// Asks the host to create a block of shared memory for the renderer.
// The shared memory allocated by the host is returned back.