Index: third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
index 553622a0dfa064f16522cfd8694dc7834f1abb48..1c8baa8e33f1f4f2879fee6898498cddea9fff7f 100644 |
--- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
+++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
@@ -295,6 +295,7 @@ ScriptPromise VRDisplay::requestPresent(ScriptState* script_state, |
submit_frame_client_binding_.CreateInterfacePtrAndBind(), |
ConvertToBaseCallback( |
WTF::Bind(&VRDisplay::OnPresentComplete, WrapPersistent(this)))); |
+ pending_present_request_ = true; |
} else { |
UpdateLayerBounds(); |
resolver->Resolve(); |
@@ -305,6 +306,7 @@ ScriptPromise VRDisplay::requestPresent(ScriptState* script_state, |
} |
void VRDisplay::OnPresentComplete(bool success) { |
+ pending_present_request_ = false; |
if (success) { |
this->BeginPresent(); |
} else { |
@@ -661,10 +663,12 @@ void VRDisplay::StopPresenting() { |
pending_previous_frame_render_ = false; |
} |
-void VRDisplay::OnActivate(device::mojom::blink::VRDisplayEventReason reason) { |
+void VRDisplay::OnActivate(device::mojom::blink::VRDisplayEventReason reason, |
+ const OnActivateCallback& on_handled) { |
AutoReset<bool> activating(&in_display_activate_, true); |
navigator_vr_->DispatchVREvent(VRDisplayEvent::Create( |
EventTypeNames::vrdisplayactivate, true, false, this, reason)); |
+ on_handled.Run(pending_present_request_); |
} |
void VRDisplay::OnDeactivate( |