diff options
author | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-04 07:09:21 +0000 |
---|---|---|
committer | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-04 07:09:21 +0000 |
commit | 97880c8bbb79a14eff349d8a128ccea48d6c4314 (patch) | |
tree | 1f62918f77fd9be58d0a9174f0a09094ea5678c4 /content/public/renderer | |
parent | 6cea1821712e08df4dc9d5e0a31cdce8187b121b (diff) | |
download | chromium_src-97880c8bbb79a14eff349d8a128ccea48d6c4314.zip chromium_src-97880c8bbb79a14eff349d8a128ccea48d6c4314.tar.gz chromium_src-97880c8bbb79a14eff349d8a128ccea48d6c4314.tar.bz2 |
Use UserMetricsAction for renderer user metrics.
Benefits of this change:
- Unified action recording. We don't need special renderer treatment in
extract_actions.py.
- UserMetricsAction() is shorter than RenderThread::Get()->RecordAction(). So
that we can have longer action names (since the action name must be on the
same line and we have 80 chars limit).
- Rename RecordUserMetrics() to RecordAction() to be consistent.
- Separate RecordComputedAction() from RecordAction() so that we can catch
unhandled computed actions.
TBR=bauerb@chromium.org
R=isherman@chromium.org
BUG=none
TEST=none
Review URL: https://codereview.chromium.org/102073005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238621 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/public/renderer')
-rw-r--r-- | content/public/renderer/render_thread.h | 19 |
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. |