Commit e1465414 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

[XProto] Add tracing for sync'ing requests

This allows us to see which calls are blocking within the context of
chrome://tracing.

BUG=None
R=sky

Change-Id: I576657f4cba0f978c025202f0f10c7ac6bcc374c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2522311
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824661}
parent 9744ac46
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <xcb/xcbext.h> #include <xcb/xcbext.h>
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
#include "base/trace_event/trace_event.h"
#include "ui/gfx/x/connection.h" #include "ui/gfx/x/connection.h"
#include "ui/gfx/x/xproto_internal.h" #include "ui/gfx/x/xproto_internal.h"
...@@ -124,8 +125,13 @@ void FutureBase::SyncImpl(RawError* raw_error, RawReply* raw_reply) { ...@@ -124,8 +125,13 @@ void FutureBase::SyncImpl(RawError* raw_error, RawReply* raw_reply) {
if (!sequence_) if (!sequence_)
return; return;
xcb_generic_error_t* error = nullptr; xcb_generic_error_t* error = nullptr;
auto* reply = reinterpret_cast<uint8_t*>( void* reply = nullptr;
xcb_wait_for_reply(connection_->XcbConnection(), *sequence_, &error)); if (!xcb_poll_for_reply(connection_->XcbConnection(), *sequence_, &reply,
&error)) {
TRACE_EVENT1("ui", "xcb_wait_for_reply", "request", request_name_);
reply =
xcb_wait_for_reply(connection_->XcbConnection(), *sequence_, &error);
}
if (reply) if (reply)
*raw_reply = base::MakeRefCounted<MallocedRefCountedMemory>(reply); *raw_reply = base::MakeRefCounted<MallocedRefCountedMemory>(reply);
if (error) if (error)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment