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

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: histogram 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
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..ed933773013103968521c8ef6f9da4fcd945392a 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc
@@ -173,6 +173,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 = SendSyncMessageFromAnyThread(msg);
+ base::TimeDelta delta = base::TimeTicks::Now() - begin;
+ ChildThread::current()->Send(new ViewHostMsg_SyncIPCElapsedTime(delta));
jam 2012/05/31 15:20:16 you can histogram from the renderer, just call HIS
kinuko 2012/05/31 17:10:36 oooops... (ashamed) done.
+ return success;
+}
+
+} // namespace
+
WebKit::WebClipboard* RendererWebKitPlatformSupportImpl::clipboard() {
return clipboard_.get();
}
@@ -215,17 +236,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) {

Powered by Google App Engine
This is Rietveld 408576698