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

Unified Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 10451076: Adding UMA for sync IPCs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | « content/renderer/renderer_webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/renderer_webkitplatformsupport_impl.cc
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc
index e83287251df0a535f171f53070d58cd659a569b8..d2f0161d888c71c0999e15a26394a0e2a5b96ba0 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/file_path.h"
#include "base/file_util.h"
+#include "base/metrics/histogram.h"
#include "base/platform_file.h"
#include "base/shared_memory.h"
#include "base/utf_string_conversions.h"
@@ -173,6 +174,27 @@ RendererWebKitPlatformSupportImpl::~RendererWebKitPlatformSupportImpl() {
//------------------------------------------------------------------------------
+namespace {
+
+bool SendSyncMessageFromAnyThreadInternal(IPC::SyncMessage* msg) {
+ RenderThreadImpl* render_thread = RenderThreadImpl::current();
+ if (render_thread)
+ return render_thread->Send(msg);
+ scoped_refptr<IPC::SyncMessageFilter> sync_msg_filter(
+ ChildThread::current()->sync_message_filter());
+ return sync_msg_filter->Send(msg);
+}
+
+bool SendSyncMessageFromAnyThread(IPC::SyncMessage* msg) {
+ base::TimeTicks begin = base::TimeTicks::Now();
+ const bool success = SendSyncMessageFromAnyThreadInternal(msg);
+ base::TimeDelta delta = base::TimeTicks::Now() - begin;
+ HISTOGRAM_TIMES("RendererSyncIPC.ElapsedTime", delta);
+ return success;
+}
+
+} // namespace
+
WebKit::WebClipboard* RendererWebKitPlatformSupportImpl::clipboard() {
return clipboard_.get();
}
@@ -215,17 +237,6 @@ bool RendererWebKitPlatformSupportImpl::sandboxEnabled() {
return !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess);
}
-bool RendererWebKitPlatformSupportImpl::SendSyncMessageFromAnyThread(
- IPC::SyncMessage* msg) {
- RenderThreadImpl* render_thread = RenderThreadImpl::current();
- if (render_thread)
- return render_thread->Send(msg);
-
- scoped_refptr<IPC::SyncMessageFilter> sync_msg_filter(
- ChildThread::current()->sync_message_filter());
- return sync_msg_filter->Send(msg);
-}
-
unsigned long long RendererWebKitPlatformSupportImpl::visitedLinkHash(
const char* canonical_url,
size_t length) {
« no previous file with comments | « content/renderer/renderer_webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698