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

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

Issue 2624263003: Add more WebVR layout tests and fix small issues they found (Closed)
Patch Set: Added a few clarifying comments Created 3 years, 11 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
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 b2d9678e3df6bc57f8254ec94587ab0119655b2b..02ec6b377874f2ac0ec9854d5a7d246e4ca57650 100644
--- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
+++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
@@ -324,9 +324,9 @@ ScriptPromise VRDisplay::requestPresent(ScriptState* scriptState,
return promise;
}
- m_layer = layers[0];
-
- if (!m_layer.source()) {
+ // If what we were given has an invalid source, need to exit fullscreen with
+ // previous, valid source, so delay m_layer reassignment
+ if (!layers[0].source()) {
bsheedy 2017/01/11 22:56:49 Changed to address https://bugs.chromium.org/p/chr
forceExitPresent();
DOMException* exception =
DOMException::create(InvalidStateError, "Invalid layer source.");
@@ -334,6 +334,7 @@ ScriptPromise VRDisplay::requestPresent(ScriptState* scriptState,
ReportPresentationResult(PresentationResult::InvalidLayerSource);
return promise;
}
+ m_layer = layers[0];
CanvasRenderingContext* renderingContext =
m_layer.source()->renderingContext();

Powered by Google App Engine
This is Rietveld 408576698