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 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(); |