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

Unified Diff: third_party/WebKit/Source/modules/vr/VRDisplay.cpp

Issue 2864363005: Prevents exiting presentation if triggering DON while presenting. (Closed)
Patch Set: Fix Created 3 years, 7 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 | « third_party/WebKit/Source/modules/vr/VRDisplay.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRDisplay.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698