Chromium Code Reviews| 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 31fbc5f152979223fcafbeaa97bdcbe2648c76b2..3526d8b90a7ce122b67722993acf5b1ceb99cdc0 100644 |
| --- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
| +++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
| @@ -183,6 +183,11 @@ void ReportPresentationResult(PresentationResult result) { |
| ScriptPromise VRDisplay::requestPresent(ScriptState* script_state, |
| const HeapVector<VRLayer>& layers) { |
| DVLOG(1) << __FUNCTION__; |
| + |
| + if (in_display_activate_) { |
| + requested_present_in_display_activate_ = true; |
| + } |
| + |
| ExecutionContext* execution_context = ExecutionContext::From(script_state); |
| UseCounter::Count(execution_context, UseCounter::kVRRequestPresent); |
| if (!execution_context->IsSecureContext()) { |
| @@ -300,7 +305,6 @@ ScriptPromise VRDisplay::requestPresent(ScriptState* script_state, |
| submit_frame_client_binding_.CreateInterfacePtrAndBind(), |
| ConvertToBaseCallback( |
| WTF::Bind(&VRDisplay::OnPresentComplete, WrapPersistent(this)))); |
| - pending_present_request_ = true; |
|
mthiesse
2017/05/10 20:12:38
You should still set the flag here, or you'll do t
tiborg
2017/05/10 20:48:57
I'm just reporting if the page requested present i
|
| } else { |
| UpdateLayerBounds(); |
| resolver->Resolve(); |
| @@ -311,7 +315,6 @@ ScriptPromise VRDisplay::requestPresent(ScriptState* script_state, |
| } |
| void VRDisplay::OnPresentComplete(bool success) { |
| - pending_present_request_ = false; |
| if (success) { |
| this->BeginPresent(); |
| } else { |
| @@ -685,7 +688,8 @@ void VRDisplay::OnActivate(device::mojom::blink::VRDisplayEventReason reason, |
| AutoReset<bool> activating(&in_display_activate_, true); |
| navigator_vr_->DispatchVREvent(VRDisplayEvent::Create( |
| EventTypeNames::vrdisplayactivate, true, false, this, reason)); |
| - on_handled.Run(pending_present_request_); |
|
mthiesse
2017/05/10 21:16:06
I think we can simply change this to:
on_handled.R
tiborg
2017/05/16 15:27:01
Done. And flipped switch as discussed offline.
|
| + on_handled.Run(requested_present_in_display_activate_); |
| + requested_present_in_display_activate_ = false; |
| } |
| void VRDisplay::OnDeactivate( |