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

Unified Diff: content/renderer/gpu/command_buffer_proxy.cc

Issue 7762013: Added GPU process "echo" IPC message. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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/gpu/command_buffer_proxy.h ('k') | content/renderer/gpu/renderer_gl_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/command_buffer_proxy.cc
===================================================================
--- content/renderer/gpu/command_buffer_proxy.cc (revision 98655)
+++ content/renderer/gpu/command_buffer_proxy.cc (working copy)
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/process_util.h"
#include "base/shared_memory.h"
+#include "base/stl_util.h"
#include "base/task.h"
#include "content/common/gpu/gpu_messages.h"
#include "content/common/plugin_messages.h"
@@ -45,9 +46,9 @@
IPC_BEGIN_MESSAGE_MAP(CommandBufferProxy, message)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_UpdateState, OnUpdateState);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Destroyed, OnDestroyed);
- IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SwapBuffers, OnSwapBuffers);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_NotifyRepaint,
OnNotifyRepaint);
+ IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_EchoAck, OnEchoAck);
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -79,6 +80,13 @@
}
}
+void CommandBufferProxy::OnEchoAck() {
+ DCHECK(!echo_tasks_.empty());
+ Task* task = echo_tasks_.front().release();
+ echo_tasks_.pop();
+ task->Run();
+}
+
void CommandBufferProxy::SetChannelErrorCallback(Callback0::Type* callback) {
channel_error_callback_.reset(callback);
}
@@ -344,9 +352,20 @@
NOTREACHED();
}
-void CommandBufferProxy::OnSwapBuffers() {
- if (swap_buffers_callback_.get())
- swap_buffers_callback_->Run();
+bool CommandBufferProxy::Echo(Task* task) {
+ if (last_state_.error != gpu::error::kNoError) {
+ delete task;
+ return false;
+ }
+
+ if (!Send(new GpuChannelMsg_Echo(GpuCommandBufferMsg_EchoAck(route_id_)))) {
+ delete task;
+ return false;
+ }
+
+ echo_tasks_.push(linked_ptr<Task>(task));
+
+ return true;
}
bool CommandBufferProxy::SetParent(CommandBufferProxy* parent_command_buffer,
@@ -376,10 +395,6 @@
return result;
}
-void CommandBufferProxy::SetSwapBuffersCallback(Callback0::Type* callback) {
- swap_buffers_callback_.reset(callback);
-}
-
void CommandBufferProxy::SetNotifyRepaintTask(Task* task) {
notify_repaint_task_.reset(task);
}
« no previous file with comments | « content/renderer/gpu/command_buffer_proxy.h ('k') | content/renderer/gpu/renderer_gl_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698