summaryrefslogtreecommitdiffstats
path: root/content/renderer/plugin_channel_host.cc
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-21 21:44:38 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-21 21:44:38 +0000
commit4c9b0d4cf2b3810f57fff67aa1ebfa53d7961296 (patch)
tree64cc2c5c5c70f76eec81b425f62c366b8f57848f /content/renderer/plugin_channel_host.cc
parentcb4c5fbce80d3adb0faf6056c0e255aa481757d8 (diff)
downloadchromium_src-4c9b0d4cf2b3810f57fff67aa1ebfa53d7961296.zip
chromium_src-4c9b0d4cf2b3810f57fff67aa1ebfa53d7961296.tar.gz
chromium_src-4c9b0d4cf2b3810f57fff67aa1ebfa53d7961296.tar.bz2
Add UMA metrics for sync renderer -> (NPAPI) plugin IPC messages.
This should allow us to monitor if NPAPI plugins (or our out-of-process NPAPI plugin host) get worse, in the aggregate. It's not as targeted as one might want, but it's the simplest possible measurement and a reasonable start. BUG=none TEST=Play with (windowless) plugins and check about:histograms. Review URL: http://codereview.chromium.org/8373001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106782 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/plugin_channel_host.cc')
-rw-r--r--content/renderer/plugin_channel_host.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/content/renderer/plugin_channel_host.cc b/content/renderer/plugin_channel_host.cc
index fb86a85..e055852 100644
--- a/content/renderer/plugin_channel_host.cc
+++ b/content/renderer/plugin_channel_host.cc
@@ -4,6 +4,8 @@
#include "content/renderer/plugin_channel_host.h"
+#include "base/metrics/histogram.h"
+#include "base/time.h"
#include "content/common/child_process.h"
#include "content/common/npobject_base.h"
#include "content/common/plugin_messages.h"
@@ -138,6 +140,17 @@ void PluginChannelHost::OnPluginShuttingDown() {
expecting_shutdown_ = true;
}
+bool PluginChannelHost::Send(IPC::Message* msg) {
+ if (msg->is_sync()) {
+ base::TimeTicks start_time(base::TimeTicks::Now());
+ bool result = NPChannelBase::Send(msg);
+ UMA_HISTOGRAM_TIMES("Plugin.SyncMessageTime",
+ base::TimeTicks::Now() - start_time);
+ return result;
+ }
+ return NPChannelBase::Send(msg);
+}
+
void PluginChannelHost::OnChannelError() {
NPChannelBase::OnChannelError();