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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 11293121: Add latency measurement system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor input event changes Created 8 years 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/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index 2612db2a68d766743fb0ce32b52b6448a6cbe3d9..5570faeb53fb7ad30a65ff5a5eb69c5d27671fa1 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -161,7 +161,8 @@ bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
if (decoder_.get() &&
message.type() != GpuCommandBufferMsg_Echo::ID &&
message.type() != GpuCommandBufferMsg_RetireSyncPoint::ID &&
- message.type() != GpuCommandBufferMsg_WaitSyncPoint::ID) {
+ message.type() != GpuCommandBufferMsg_WaitSyncPoint::ID &&
+ message.type() != GpuCommandBufferMsg_SetLatencyInfo::ID) {
if (!MakeCurrent())
return false;
}
@@ -183,6 +184,7 @@ bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_GetStateFast,
OnGetStateFast);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush);
+ IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SetLatencyInfo, OnSetLatencyInfo);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Rescheduled, OnRescheduled);
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_CreateTransferBuffer,
OnCreateTransferBuffer);
@@ -523,6 +525,22 @@ void GpuCommandBufferStub::OnInitialize(
}
}
+void GpuCommandBufferStub::OnSetLatencyInfo(
+ const WebKit::WebLatencyInfoImpl& latency_info) {
+ if (!latency_info_callback_.is_null())
+ latency_info_callback_.Run(latency_info);
+}
+
+void GpuCommandBufferStub::SetLatencyInfoCallback(
+ const LatencyInfoCallback& callback) {
+ latency_info_callback_ = callback;
+}
+
+void GpuCommandBufferStub::SetLatencyInfo(
+ const WebKit::WebLatencyInfoImpl& latency_info) {
+ Send(new GpuCommandBufferMsg_SetLatencyInfo(route_id_, latency_info));
+}
+
void GpuCommandBufferStub::OnSetGetBuffer(
int32 shm_id, IPC::Message* reply_message) {
TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetGetBuffer");

Powered by Google App Engine
This is Rietveld 408576698