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

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

Issue 2711173002: Prevent browser crash resulting from misbehaving WebVR renderer requesting multiple VSyncs. (Closed)
Patch Set: rebase Created 3 years, 10 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 | « no previous file | chrome/browser/android/vr_shell/vr_shell_gl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
diff --git a/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc b/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
index 07e910a482efbd4405030a0d4c03d5cafe51be13..c25da54458e04fc8f1922be5bb5c9247182402dd 100644
--- a/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
+++ b/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
@@ -61,7 +61,9 @@ NonPresentingGvrDelegate::OnSwitchToPresentingDelegate() {
void NonPresentingGvrDelegate::StopVSyncLoop() {
vsync_task_.Cancel();
if (!callback_.is_null()) {
- base::ResetAndReturn(&callback_).Run(nullptr, base::TimeDelta(), -1);
+ base::ResetAndReturn(&callback_)
+ .Run(nullptr, base::TimeDelta(), -1,
+ device::mojom::VRVSyncProvider::Status::RETRY);
}
gvr_api_->PauseTracking();
// If the loop is stopped, it's not considered to be paused.
@@ -111,6 +113,7 @@ void NonPresentingGvrDelegate::GetVSync(const GetVSyncCallback& callback) {
mojo::ReportBadMessage(
"Requested VSync before waiting for response to "
"previous request.");
+ binding_.Close();
return;
}
callback_ = callback;
@@ -135,7 +138,8 @@ void NonPresentingGvrDelegate::SendVSync(base::TimeDelta time,
gvr::Mat4f head_mat = gvr_api_->ApplyNeckModel(
gvr_api_->GetHeadSpaceFromStartSpaceRotation(target_time), 1.0f);
- callback.Run(VrShell::VRPosePtrFromGvrPose(head_mat), time, -1);
+ callback.Run(VrShell::VRPosePtrFromGvrPose(head_mat), time, -1,
+ device::mojom::VRVSyncProvider::Status::SUCCESS);
}
bool NonPresentingGvrDelegate::SupportsPresentation() {
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/vr_shell_gl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698