Chromium Code Reviews| Index: services/ui/public/cpp/lib/command_buffer_client_impl.cc |
| diff --git a/services/ui/public/cpp/lib/command_buffer_client_impl.cc b/services/ui/public/cpp/lib/command_buffer_client_impl.cc |
| index c4566d5f93515875033b8903e0dfede19d998ae1..7788065066b889cc89d9c9575941e6b6df3420ef 100644 |
| --- a/services/ui/public/cpp/lib/command_buffer_client_impl.cc |
| +++ b/services/ui/public/cpp/lib/command_buffer_client_impl.cc |
| @@ -40,16 +40,6 @@ bool CreateAndMapSharedBuffer(size_t size, |
| return true; |
| } |
| -void MakeProgressCallback(gpu::CommandBuffer::State* output, |
| - const gpu::CommandBuffer::State& input) { |
| - *output = input; |
| -} |
| - |
| -void InitializeCallback(ui::mojom::CommandBufferInitializeResultPtr* output, |
| - ui::mojom::CommandBufferInitializeResultPtr input) { |
| - *output = std::move(input); |
| -} |
| - |
| } // namespace |
| CommandBufferClientImpl::CommandBufferClientImpl( |
| @@ -87,13 +77,11 @@ bool CommandBufferClientImpl::Initialize() { |
| client_binding_.Bind(GetProxy(&client_ptr)); |
| ui::mojom::CommandBufferInitializeResultPtr initialize_result; |
| - command_buffer_->Initialize( |
| + bool handled = command_buffer_->Initialize( |
|
Peng
2016/07/06 17:31:02
result = command_buffer_->Initialize(?
leonhsl(Using Gerrit)
2016/07/07 07:43:12
Done.
|
| std::move(client_ptr), std::move(handle), |
| - mojo::Array<int32_t>::From(attribs_), |
| - base::Bind(&InitializeCallback, &initialize_result)); |
| + mojo::Array<int32_t>::From(attribs_), &initialize_result); |
| - base::ThreadRestrictions::ScopedAllowWait wait; |
| - if (!command_buffer_.WaitForIncomingResponse()) { |
| + if (!handled) { |
| VLOG(1) << "Channel encountered error while creating command buffer."; |
| return false; |
| } |
| @@ -297,11 +285,9 @@ void CommandBufferClientImpl::TryUpdateState() { |
| void CommandBufferClientImpl::MakeProgressAndUpdateState() { |
| gpu::CommandBuffer::State state; |
| - command_buffer_->MakeProgress(last_state_.get_offset, |
| - base::Bind(&MakeProgressCallback, &state)); |
| + bool handled = command_buffer_->MakeProgress(last_state_.get_offset, &state); |
|
Peng
2016/07/06 17:31:02
bool result = command_buffer_->MakeProgress(...?
leonhsl(Using Gerrit)
2016/07/07 07:43:12
Done.
|
| - base::ThreadRestrictions::ScopedAllowWait wait; |
| - if (!command_buffer_.WaitForIncomingResponse()) { |
| + if (!handled) { |
| VLOG(1) << "Channel encountered error while waiting for command buffer."; |
| // TODO(piman): is it ok for this to re-enter? |
| Destroyed(gpu::error::kUnknown, gpu::error::kLostContext); |