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

Unified Diff: chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc

Issue 2551983002: Suffix VrShell calls with which thread they're expected to be run on. (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_web_contents_observer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc
diff --git a/chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc b/chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc
index 02ec68557e732153f2b1086a1f6641632ffc93a6..06d945776653501f8d690a1bd2ad1da8250b8737 100644
--- a/chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc
+++ b/chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc
@@ -19,12 +19,12 @@ VrShellUIMessageHandler::VrShellUIMessageHandler() = default;
VrShellUIMessageHandler::~VrShellUIMessageHandler() {
if (vr_shell_) {
- vr_shell_->GetUiInterface()->SetUiCommandHandler(nullptr);
+ vr_shell_->GetUiInterfaceOnGL()->SetUiCommandHandler(nullptr);
}
}
void VrShellUIMessageHandler::RegisterMessages() {
- vr_shell_ = vr_shell::VrShell::GetWeakPtr(web_ui()->GetWebContents());
+ vr_shell_ = vr_shell::VrShell::GetWeakPtrOnUI(web_ui()->GetWebContents());
web_ui()->RegisterMessageCallback(
"domLoaded", base::Bind(&VrShellUIMessageHandler::HandleDomLoaded,
@@ -51,8 +51,8 @@ void VrShellUIMessageHandler::OnJavascriptAllowed() {
// deleted.
if (!vr_shell_)
return;
- vr_shell_->GetUiInterface()->SetUiCommandHandler(this);
- vr_shell_->OnDomContentsLoaded();
+ vr_shell_->GetUiInterfaceOnGL()->SetUiCommandHandler(this);
+ vr_shell_->OnDomContentsLoadedOnUI();
}
void VrShellUIMessageHandler::HandleUpdateScene(const base::ListValue* args) {
@@ -61,17 +61,18 @@ void VrShellUIMessageHandler::HandleUpdateScene(const base::ListValue* args) {
// Copy the update instructions and handle them on the render thread.
auto cb = base::Bind(&vr_shell::UiScene::HandleCommands,
- base::Unretained(vr_shell_->GetScene()),
+ // TODO(mthiesse): Clean up threading around scene class.
+ base::Unretained(vr_shell_->GetSceneOnGL()),
base::Owned(args->CreateDeepCopy().release()),
vr_shell::UiScene::TimeInMicroseconds());
- vr_shell_->QueueTask(cb);
+ vr_shell_->QueueTaskOnUI(cb);
}
void VrShellUIMessageHandler::HandleDoAction(const base::ListValue* args) {
int action;
CHECK(args->GetInteger(0, &action));
if (vr_shell_) {
- vr_shell_->DoUiAction((vr_shell::UiAction) action);
+ vr_shell_->DoUiActionOnUI((vr_shell::UiAction) action);
}
}
@@ -82,7 +83,7 @@ void VrShellUIMessageHandler::HandleSetUiCssSize(const base::ListValue* args) {
CHECK(args->GetDouble(1, &height));
CHECK(args->GetDouble(2, &dpr));
if (vr_shell_) {
- vr_shell_->SetUiCssSize(width, height, dpr);
+ vr_shell_->SetUiCssSizeOnUI(width, height, dpr);
}
}
« no previous file with comments | « chrome/browser/android/vr_shell/vr_web_contents_observer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698