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

Unified Diff: services/gles2/command_buffer_impl.cc

Issue 868203003: De-Client CommandBuffer interface (Closed) Base URL: git@github.com:domokit/mojo.git@fix_sample_app
Patch Set: Created 5 years, 11 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 | « services/gles2/command_buffer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/gles2/command_buffer_impl.cc
diff --git a/services/gles2/command_buffer_impl.cc b/services/gles2/command_buffer_impl.cc
index 129238c5851a2091d89cbee5f249dea0fd62db55..c370068924bee2e900bfcc102247688d758955d0 100644
--- a/services/gles2/command_buffer_impl.cc
+++ b/services/gles2/command_buffer_impl.cc
@@ -28,8 +28,6 @@ class CommandBufferDriverClientImpl : public CommandBufferDriver::Client {
control_task_runner_(control_task_runner) {}
private:
- void DidDestroy() override { delete this; }
-
void UpdateVSyncParameters(base::TimeTicks timebase,
base::TimeDelta interval) override {
control_task_runner_->PostTask(
@@ -37,10 +35,10 @@ class CommandBufferDriverClientImpl : public CommandBufferDriver::Client {
command_buffer_, timebase, interval));
}
- void LostContext(int32_t lost_reason) override {
+ void DidLoseContext() override {
control_task_runner_->PostTask(
- FROM_HERE, base::Bind(&CommandBufferImpl::LostContext, command_buffer_,
- lost_reason));
+ FROM_HERE, base::Bind(&CommandBufferImpl::DidLoseContext,
+ command_buffer_));
}
base::WeakPtr<CommandBufferImpl> command_buffer_;
@@ -60,8 +58,8 @@ CommandBufferImpl::CommandBufferImpl(
viewport_parameter_listener_(listener.Pass()),
binding_(this),
weak_factory_(this) {
- driver_->set_client(new CommandBufferDriverClientImpl(
- weak_factory_.GetWeakPtr(), control_task_runner));
+ driver_->set_client(make_scoped_ptr(new CommandBufferDriverClientImpl(
+ weak_factory_.GetWeakPtr(), control_task_runner)));
control_task_runner->PostTask(
FROM_HERE, base::Bind(&CommandBufferImpl::BindToRequest,
@@ -69,7 +67,6 @@ CommandBufferImpl::CommandBufferImpl(
}
CommandBufferImpl::~CommandBufferImpl() {
- binding_.client()->DidDestroy();
driver_task_runner_->PostTask(
FROM_HERE, base::Bind(&DestroyDriver, base::Passed(&driver_)));
}
@@ -77,12 +74,14 @@ CommandBufferImpl::~CommandBufferImpl() {
void CommandBufferImpl::Initialize(
mojo::CommandBufferSyncClientPtr sync_client,
mojo::CommandBufferSyncPointClientPtr sync_point_client,
+ mojo::CommandBufferLostContextObserverPtr loss_observer,
mojo::ScopedSharedBufferHandle shared_state) {
sync_point_client_ = sync_point_client.Pass();
driver_task_runner_->PostTask(
FROM_HERE,
base::Bind(&CommandBufferDriver::Initialize,
base::Unretained(driver_.get()), base::Passed(&sync_client),
+ base::Passed(&loss_observer),
base::Passed(&shared_state)));
}
@@ -146,8 +145,8 @@ void CommandBufferImpl::BindToRequest(
binding_.Bind(request.Pass());
}
-void CommandBufferImpl::LostContext(int32_t reason) {
- binding_.client()->LostContext(reason);
+void CommandBufferImpl::DidLoseContext() {
+ binding_.OnConnectionError();
}
void CommandBufferImpl::UpdateVSyncParameters(base::TimeTicks timebase,
« no previous file with comments | « services/gles2/command_buffer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698