| 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 7c76114d50501e017583313962039ed7914c5333..c0f5d68c3d8315aa83882c178be992141c3525f2 100644
|
| --- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
|
| +++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
|
| @@ -678,10 +678,17 @@ void VRDisplay::OnDeactivate(
|
| }
|
|
|
| void VRDisplay::processScheduledAnimations(double timestamp) {
|
| + // Check if we still have a valid context, the animation controller
|
| + // or document may have disappeared since we scheduled this.
|
| + Document* doc = this->document();
|
| + if (!doc || m_displayBlurred || !m_scriptedAnimationController)
|
| + return;
|
| +
|
| TRACE_EVENT1("gpu", "VRDisplay::OnVSync", "frame", m_vrFrameId);
|
|
|
| AutoReset<bool> animating(&m_inAnimationFrame, true);
|
| m_pendingRaf = false;
|
| +
|
| m_scriptedAnimationController->serviceScriptedAnimations(timestamp);
|
| }
|
|
|
| @@ -698,13 +705,6 @@ void VRDisplay::OnVSync(device::mojom::blink::VRPosePtr pose,
|
| return;
|
| }
|
| m_pendingVsync = false;
|
| - if (m_displayBlurred)
|
| - return;
|
| - if (!m_scriptedAnimationController)
|
| - return;
|
| - Document* doc = this->document();
|
| - if (!doc)
|
| - return;
|
|
|
| WTF::TimeDelta timeDelta =
|
| WTF::TimeDelta::FromMicroseconds(time->microseconds);
|
|
|