De-Client CommandBuffer interface
This removes the CommandBufferClient interface from mojo.CommandBuffer.
It had two methods on it:
*) DidDestroy() which is redundant with the pipe closing, removed.
*) DidLoseContext(uint32 reason) which is used to signal an error code
prior to the pipe closing. Replaced with an observer interface.
BUG=451319
R=sky@chromium.org
Review URL: https://codereview.chromium.org/868203003
diff --git a/services/gles2/command_buffer_driver.cc b/services/gles2/command_buffer_driver.cc
index 5d159b4..98b8578 100644
--- a/services/gles2/command_buffer_driver.cc
+++ b/services/gles2/command_buffer_driver.cc
@@ -81,13 +81,14 @@
bool have_context = decoder_->MakeCurrent();
decoder_->Destroy(have_context);
}
- client_->DidDestroy();
}
void CommandBufferDriver::Initialize(
mojo::CommandBufferSyncClientPtr sync_client,
+ mojo::CommandBufferLostContextObserverPtr loss_observer,
mojo::ScopedSharedBufferHandle shared_state) {
sync_client_ = sync_client.Pass();
+ loss_observer_ = loss_observer.Pass();
bool success = DoInitialize(shared_state.Pass());
mojo::GpuCapabilitiesPtr capabilities =
success ? mojo::GpuCapabilities::From(decoder_->GetCapabilities())
@@ -238,7 +239,8 @@
}
void CommandBufferDriver::OnContextLost(uint32_t reason) {
- client_->LostContext(reason);
+ loss_observer_->DidLoseContext(reason);
+ client_->DidLoseContext();
}
void CommandBufferDriver::OnUpdateVSyncParameters(