Chromium Code Reviews| Index: chrome/browser/android/vr_shell/vr_shell.cc |
| diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc |
| index 049855683b7f4467971c4447786c09ea36982a8f..2ab08025e195071868ea925690c45965fc282ca0 100644 |
| --- a/chrome/browser/android/vr_shell/vr_shell.cc |
| +++ b/chrome/browser/android/vr_shell/vr_shell.cc |
| @@ -9,6 +9,7 @@ |
| #include "base/threading/thread.h" |
| #include "base/threading/thread_restrictions.h" |
| #include "base/threading/thread_task_runner_handle.h" |
| +#include "base/values.h" |
| #include "chrome/browser/android/vr_shell/ui_interface.h" |
| #include "chrome/browser/android/vr_shell/vr_compositor.h" |
| #include "chrome/browser/android/vr_shell/vr_input_manager.h" |
| @@ -324,23 +325,19 @@ void VrShell::UIBoundsChanged(JNIEnv* env, |
| ui_compositor_->SetWindowBounds(width, height); |
| } |
| -UiScene* VrShell::GetScene() { |
| - GLThread* thread = static_cast<GLThread*>(gl_thread_.get()); |
| - // TODO(mthiesse): Remove this blocking wait. Queue up events if thread isn't |
| - // finished starting? |
| - thread->WaitUntilThreadStarted(); |
| - if (thread->GetVrShellGlUnsafe()) { |
| - return thread->GetVrShellGlUnsafe()->GetScene(); |
| - } |
| - return nullptr; |
| -} |
| - |
| UiInterface* VrShell::GetUiInterface() { |
| return html_interface_.get(); |
| } |
| -void VrShell::QueueTask(base::Callback<void()>& callback) { |
| - gl_thread_->task_runner()->PostTask(FROM_HERE, callback); |
| +void VrShell::UpdateScene(const base::ListValue* args) { |
| + GLThread* thread = static_cast<GLThread*>(gl_thread_.get()); |
| + // TODO(mthiesse): Remove this blocking wait. Queue up events if thread isn't |
| + // finished starting? |
| + thread->WaitUntilThreadStarted(); |
|
bshe
2016/12/14 22:05:13
you can probably use the new function that you cre
mthiesse
2016/12/14 22:39:32
This one will probably land first. I'll do this wh
|
| + thread->task_runner()->PostTask( |
| + FROM_HERE, base::Bind(&VrShellGl::UpdateScene, |
| + thread->GetVrShellGl(), |
| + base::Passed(args->CreateDeepCopy()))); |
| } |
| void VrShell::DoUiAction(const UiAction action) { |