Index: mojo/gles2/command_buffer_client_impl.cc |
diff --git a/mojo/gles2/command_buffer_client_impl.cc b/mojo/gles2/command_buffer_client_impl.cc |
index 8beef82fa47cdd24e75951fb4ed58ff43d56e8a5..9c05f4fcb1a42d323c332fcfb770a6b8ce7db0df 100644 |
--- a/mojo/gles2/command_buffer_client_impl.cc |
+++ b/mojo/gles2/command_buffer_client_impl.cc |
@@ -50,13 +50,17 @@ void CommandBufferDelegate::DrawAnimationFrame() {} |
CommandBufferClientImpl::CommandBufferClientImpl( |
CommandBufferDelegate* delegate, |
MojoAsyncWaiter* async_waiter, |
- ScopedCommandBufferHandle command_buffer_handle) |
+ ScopedMessagePipeHandle command_buffer_handle) |
: delegate_(delegate), |
- command_buffer_(command_buffer_handle.Pass(), this, this, async_waiter), |
+ command_buffer_(MakeProxy<mojo::CommandBuffer>( |
+ command_buffer_handle.Pass(), async_waiter)), |
shared_state_(NULL), |
last_put_offset_(-1), |
next_transfer_buffer_id_(0), |
- initialize_result_(false) {} |
+ initialize_result_(false) { |
+ command_buffer_.set_error_handler(this); |
+ command_buffer_->SetClient(this); |
+} |
CommandBufferClientImpl::~CommandBufferClientImpl() {} |
@@ -73,11 +77,14 @@ bool CommandBufferClientImpl::Initialize() { |
shared_state()->Initialize(); |
- InterfacePipe<CommandBufferSyncClient, NoInterface> sync_pipe; |
+ // TODO(darin): We need better sugar for sync calls. |
+ MessagePipe sync_pipe; |
sync_dispatcher_.reset(new SyncDispatcher<CommandBufferSyncClient>( |
- sync_pipe.handle_to_peer.Pass(), this)); |
+ sync_pipe.handle0.Pass(), this)); |
+ CommandBufferSyncClientPtr sync_client = |
+ MakeProxy<CommandBufferSyncClient>(sync_pipe.handle1.Pass()); |
AllocationScope scope; |
- command_buffer_->Initialize(sync_pipe.handle_to_self.Pass(), duped.Pass()); |
+ command_buffer_->Initialize(sync_client.Pass(), duped.Pass()); |
// Wait for DidInitialize to come on the sync client pipe. |
if (!sync_dispatcher_->WaitAndDispatchOneMessage()) { |
VLOG(1) << "Channel encountered error while creating command buffer"; |
@@ -243,7 +250,9 @@ void CommandBufferClientImpl::LostContext(int32_t lost_reason) { |
delegate_->ContextLost(); |
} |
-void CommandBufferClientImpl::OnError() { LostContext(gpu::error::kUnknown); } |
+void CommandBufferClientImpl::OnConnectionError() { |
+ LostContext(gpu::error::kUnknown); |
+} |
void CommandBufferClientImpl::TryUpdateState() { |
if (last_state_.error == gpu::error::kNoError) |