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

Unified Diff: chrome/browser/android/vr_shell/vr_shell.cc

Issue 2574313002: Clean up threading around VR Scene updates. (Closed)
Patch Set: rebase Created 4 years 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 | « chrome/browser/android/vr_shell/vr_shell.h ('k') | chrome/browser/android/vr_shell/vr_shell_gl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3686175123e271d770ecf91ad120c1bf3fed75f4..834a7f59e46aea8db426361c964c1e16bbadb939 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"
@@ -319,23 +320,19 @@ void VrShell::UIBoundsChanged(JNIEnv* env,
ui_compositor_->SetWindowBounds(gfx::Size(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();
+ thread->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&VrShellGl::UpdateScene,
+ thread->GetVrShellGl(),
+ base::Passed(args->CreateDeepCopy())));
}
void VrShell::DoUiAction(const UiAction action) {
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.h ('k') | chrome/browser/android/vr_shell/vr_shell_gl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698