| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/vr/VRDisplay.h" | 5 #include "modules/vr/VRDisplay.h" |
| 6 | 6 |
| 7 #include "core/css/StylePropertySet.h" | 7 #include "core/css/StylePropertySet.h" |
| 8 #include "core/dom/DOMException.h" | 8 #include "core/dom/DOMException.h" |
| 9 #include "core/dom/DocumentUserGestureToken.h" | 9 #include "core/dom/DocumentUserGestureToken.h" |
| 10 #include "core/dom/FrameRequestCallback.h" | 10 #include "core/dom/FrameRequestCallback.h" |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 ExecutionContext* VRDisplay::getExecutionContext() const { | 746 ExecutionContext* VRDisplay::getExecutionContext() const { |
| 747 return ContextLifecycleObserver::getExecutionContext(); | 747 return ContextLifecycleObserver::getExecutionContext(); |
| 748 } | 748 } |
| 749 | 749 |
| 750 const AtomicString& VRDisplay::interfaceName() const { | 750 const AtomicString& VRDisplay::interfaceName() const { |
| 751 return EventTargetNames::VRDisplay; | 751 return EventTargetNames::VRDisplay; |
| 752 } | 752 } |
| 753 | 753 |
| 754 void VRDisplay::contextDestroyed(ExecutionContext*) { | 754 void VRDisplay::contextDestroyed(ExecutionContext*) { |
| 755 forceExitPresent(); | 755 forceExitPresent(); |
| 756 m_scriptedAnimationController.clear(); |
| 756 } | 757 } |
| 757 | 758 |
| 758 bool VRDisplay::hasPendingActivity() const { | 759 bool VRDisplay::hasPendingActivity() const { |
| 759 // Prevent V8 from garbage collecting the wrapper object if there are | 760 // Prevent V8 from garbage collecting the wrapper object if there are |
| 760 // event listeners attached to it. | 761 // event listeners attached to it. |
| 761 return getExecutionContext() && hasEventListeners(); | 762 return getExecutionContext() && hasEventListeners(); |
| 762 } | 763 } |
| 763 | 764 |
| 764 DEFINE_TRACE(VRDisplay) { | 765 DEFINE_TRACE(VRDisplay) { |
| 765 EventTargetWithInlineData::trace(visitor); | 766 EventTargetWithInlineData::trace(visitor); |
| 766 ContextLifecycleObserver::trace(visitor); | 767 ContextLifecycleObserver::trace(visitor); |
| 767 visitor->trace(m_navigatorVR); | 768 visitor->trace(m_navigatorVR); |
| 768 visitor->trace(m_capabilities); | 769 visitor->trace(m_capabilities); |
| 769 visitor->trace(m_stageParameters); | 770 visitor->trace(m_stageParameters); |
| 770 visitor->trace(m_eyeParametersLeft); | 771 visitor->trace(m_eyeParametersLeft); |
| 771 visitor->trace(m_eyeParametersRight); | 772 visitor->trace(m_eyeParametersRight); |
| 772 visitor->trace(m_layer); | 773 visitor->trace(m_layer); |
| 773 visitor->trace(m_renderingContext); | 774 visitor->trace(m_renderingContext); |
| 774 visitor->trace(m_scriptedAnimationController); | 775 visitor->trace(m_scriptedAnimationController); |
| 775 visitor->trace(m_pendingPresentResolvers); | 776 visitor->trace(m_pendingPresentResolvers); |
| 776 } | 777 } |
| 777 | 778 |
| 778 } // namespace blink | 779 } // namespace blink |
| OLD | NEW |