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

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

Issue 2711173002: Prevent browser crash resulting from misbehaving WebVR renderer requesting multiple VSyncs. (Closed)
Patch Set: 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 | « chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc ('k') | device/vr/vr_service.mojom » ('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_gl.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.cc b/chrome/browser/android/vr_shell/vr_shell_gl.cc
index 73afb7117c0ac2266959055deaf971b4f109f303..d78088568e784b92a11f6a0905cef706d6fb4a3f 100644
--- a/chrome/browser/android/vr_shell/vr_shell_gl.cc
+++ b/chrome/browser/android/vr_shell/vr_shell_gl.cc
@@ -175,7 +175,9 @@ VrShellGl::VrShellGl(
VrShellGl::~VrShellGl() {
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::Error::ERROR_TRY_AGAIN);
bajones 2017/02/23 17:21:22 Could you clarify this? If the VSyncProvider is be
mthiesse 2017/02/23 18:11:58 Added comments.
}
if (binding_.is_bound()) {
main_thread_task_runner_->PostTask(FROM_HERE, base::Bind(
@@ -1091,6 +1093,8 @@ void VrShellGl::OnRequest(device::mojom::VRVSyncProviderRequest request) {
void VrShellGl::GetVSync(const GetVSyncCallback& callback) {
if (!pending_vsync_) {
if (!callback_.is_null()) {
+ callback.Run(nullptr, base::TimeDelta(), -1,
+ device::mojom::VRVSyncProvider::Error::ERROR_BAD_REQUEST);
mojo::ReportBadMessage("Requested VSync before waiting for response to "
"previous request.");
return;
@@ -1135,7 +1139,8 @@ void VrShellGl::SendVSync(base::TimeDelta time,
webvr_head_pose_[frame_index % kPoseRingBufferSize] = head_mat;
- callback.Run(VrShell::VRPosePtrFromGvrPose(head_mat), time, frame_index);
+ callback.Run(VrShell::VRPosePtrFromGvrPose(head_mat), time, frame_index,
+ device::mojom::VRVSyncProvider::Error::ERROR_NONE);
}
void VrShellGl::ResetPose() {
« no previous file with comments | « chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc ('k') | device/vr/vr_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698