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

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

Issue 12356002: [NOT FOR COMMIT] Hacks to merge render compositor thread with UI thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: New thread restriction allows (incomplete patch) Created 7 years, 10 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/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 550c17433f05f26415d07ccc53718e2c66d05563..3e258a84d46ea0aaa585065392399108aba4bd92 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -37,6 +37,8 @@
#include "content/common/gpu/stream_texture_manager_android.h"
#endif
+#include "base/threading/thread_restrictions.h"
boliu 2013/03/01 00:19:12 oops, no needed
+
namespace content {
namespace {
@@ -172,14 +174,14 @@ bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(GpuCommandBufferStub, message)
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_Initialize,
OnInitialize);
- IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_SetGetBuffer,
- OnSetGetBuffer);
+ IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SetGetBuffer,
+ OnSetGetBuffer);
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_SetParent,
OnSetParent);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Echo, OnEcho);
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_GetState, OnGetState);
- IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_GetStateFast,
- OnGetStateFast);
+ IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_GetStateFast,
+ OnGetStateFast);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Rescheduled, OnRescheduled);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RegisterTransferBuffer,
@@ -521,12 +523,10 @@ void GpuCommandBufferStub::OnInitialize(
}
}
-void GpuCommandBufferStub::OnSetGetBuffer(int32 shm_id,
- IPC::Message* reply_message) {
+void GpuCommandBufferStub::OnSetGetBuffer(int32 shm_id) {
TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetGetBuffer");
if (command_buffer_.get())
command_buffer_->SetGetBuffer(shm_id);
- Send(reply_message);
}
void GpuCommandBufferStub::OnSetParent(int32 parent_route_id,
@@ -588,16 +588,13 @@ void GpuCommandBufferStub::OnParseError() {
handle_.is_null(), state.context_lost_reason, active_url_));
}
-void GpuCommandBufferStub::OnGetStateFast(IPC::Message* reply_message) {
+void GpuCommandBufferStub::OnGetStateFast(gpu::CommandBuffer::State* state) {
TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnGetStateFast");
DCHECK(command_buffer_.get());
- gpu::CommandBuffer::State state = command_buffer_->GetState();
- if (state.error == gpu::error::kLostContext &&
+ *state = command_buffer_->GetState();
+ if (state->error == gpu::error::kLostContext &&
gfx::GLContext::LosesAllContextsOnContextLost())
channel_->LoseAllContexts();
-
- GpuCommandBufferMsg_GetStateFast::WriteReplyParams(reply_message, state);
- Send(reply_message);
}
void GpuCommandBufferStub::OnAsyncFlush(int32 put_offset,

Powered by Google App Engine
This is Rietveld 408576698