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) { |