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

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

Issue 2572013003: Remove unnecessary threading concerns from VrMetricsHelper. (Closed)
Patch Set: 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_usage_monitor.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 049855683b7f4467971c4447786c09ea36982a8f..f12b8667e834585a3dc7e35af782824799eebfe5 100644
--- a/chrome/browser/android/vr_shell/vr_shell.cc
+++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -106,9 +106,11 @@ VrShell::VrShell(JNIEnv* env,
gvr_context* gvr_api)
: WebContentsObserver(ui_contents),
main_contents_(main_contents),
+ content_compositor_(new VrCompositor(content_window, false)),
ui_contents_(ui_contents),
+ ui_compositor_(new VrCompositor(ui_window, true)),
delegate_(delegate),
- metrics_helper_(new VrMetricsHelper(main_contents)),
+ metrics_helper_(new VrMetricsHelper(main_contents_)),
main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()),
weak_ptr_factory_(this) {
DCHECK(g_instance == nullptr);
@@ -118,6 +120,9 @@ VrShell::VrShell(JNIEnv* env,
content_input_manager_.reset(new VrInputManager(main_contents_));
ui_input_manager_.reset(new VrInputManager(ui_contents_));
+ content_compositor_->SetLayer(main_contents_);
+ ui_compositor_->SetLayer(ui_contents_);
+
gl_thread_.reset(new GLThread(this, weak_ptr_factory_.GetWeakPtr(),
content_input_manager_->GetWeakPtr(),
ui_input_manager_->GetWeakPtr(),
@@ -133,10 +138,6 @@ VrShell::VrShell(JNIEnv* env,
html_interface_.reset(new UiInterface(
for_web_vr ? UiInterface::Mode::WEB_VR : UiInterface::Mode::STANDARD,
main_contents_->IsFullscreen()));
- content_compositor_.reset(new VrCompositor(content_window, false));
- content_compositor_->SetLayer(main_contents_);
- ui_compositor_.reset(new VrCompositor(ui_window, true));
- ui_compositor_->SetLayer(ui_contents_);
vr_web_contents_observer_.reset(new VrWebContentsObserver(
main_contents, html_interface_.get(), this));
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.h ('k') | chrome/browser/android/vr_shell/vr_usage_monitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698