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

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

Issue 2453943002: Exit VR Shell on pause (And fix a bunch of minor bugs). (Closed)
Patch Set: Rebase Created 4 years, 2 months 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_delegate.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 0f8a6325821e161b084a3cb9df87059be753d00a..7eb33f110f6836998ec784e8f325605d9862e22a 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
@@ -42,7 +42,12 @@ void VrShellUIMessageHandler::HandleDomLoaded(const base::ListValue* args) {
}
void VrShellUIMessageHandler::OnJavascriptAllowed() {
- CHECK(vr_shell_);
+ // If we don't have a VR Shell here, it means either the user manually loaded
+ // this webui page and we want to silently fail to connect to native vr shell,
+ // or VR Shell was deleted, and this webui content is also about to be
+ // deleted.
+ if (!vr_shell_)
+ return;
vr_shell_->GetUiInterface()->SetUiCommandHandler(this);
vr_shell_->OnDomContentsLoaded();
}
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698