| Index: mojo/services/gles2/command_buffer_driver.cc
|
| diff --git a/mojo/services/gles2/command_buffer_driver.cc b/mojo/services/gles2/command_buffer_driver.cc
|
| index 86534bb122e0b5c4f354a8f40a1f6cd49a28c748..8e30349b8421081f909c8fa02b6921a63631b9f2 100644
|
| --- a/mojo/services/gles2/command_buffer_driver.cc
|
| +++ b/mojo/services/gles2/command_buffer_driver.cc
|
| @@ -181,8 +181,14 @@ void CommandBufferDriver::DestroyTransferBuffer(int32_t id) {
|
| command_buffer_->DestroyTransferBuffer(id);
|
| }
|
|
|
| +void CommandBufferDriver::Echo(const Callback<void()>& callback) {
|
| + callback.Run();
|
| +}
|
| +
|
| void CommandBufferDriver::SetContextLostCallback(
|
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner,
|
| const base::Callback<void(int32_t)>& callback) {
|
| + context_lost_task_runner_ = task_runner;
|
| context_lost_callback_ = callback;
|
| }
|
|
|
| @@ -196,8 +202,10 @@ void CommandBufferDriver::OnResize(gfx::Size size, float scale_factor) {
|
| }
|
|
|
| void CommandBufferDriver::OnContextLost(uint32_t reason) {
|
| - if (!context_lost_callback_.is_null())
|
| - context_lost_callback_.Run(reason);
|
| + if (!context_lost_callback_.is_null()) {
|
| + context_lost_task_runner_->PostTask(
|
| + FROM_HERE, base::Bind(context_lost_callback_, reason));
|
| + }
|
| }
|
|
|
| } // namespace mojo
|
|
|