Chromium Code Reviews| 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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 743 } | 743 } |
| 744 | 744 |
| 745 ExecutionContext* VRDisplay::getExecutionContext() const { | 745 ExecutionContext* VRDisplay::getExecutionContext() const { |
| 746 return ContextLifecycleObserver::getExecutionContext(); | 746 return ContextLifecycleObserver::getExecutionContext(); |
| 747 } | 747 } |
| 748 | 748 |
| 749 const AtomicString& VRDisplay::interfaceName() const { | 749 const AtomicString& VRDisplay::interfaceName() const { |
| 750 return EventTargetNames::VRDisplay; | 750 return EventTargetNames::VRDisplay; |
| 751 } | 751 } |
| 752 | 752 |
| 753 void VRDisplay::contextDestroyed() { | 753 void VRDisplay::contextDestroyed() { |
|
mthiesse
2017/01/13 00:34:19
Why ::contextDestroyed() rather than ::dispose()?
| |
| 754 forceExitPresent(); | 754 forceExitPresent(); |
| 755 m_scriptedAnimationController.clear(); | |
| 755 } | 756 } |
| 756 | 757 |
| 757 bool VRDisplay::hasPendingActivity() const { | 758 bool VRDisplay::hasPendingActivity() const { |
| 758 // Prevent V8 from garbage collecting the wrapper object if there are | 759 // Prevent V8 from garbage collecting the wrapper object if there are |
| 759 // event listeners attached to it. | 760 // event listeners attached to it. |
| 760 return getExecutionContext() && hasEventListeners(); | 761 return getExecutionContext() && hasEventListeners(); |
| 761 } | 762 } |
| 762 | 763 |
| 763 DEFINE_TRACE(VRDisplay) { | 764 DEFINE_TRACE(VRDisplay) { |
| 764 EventTargetWithInlineData::trace(visitor); | 765 EventTargetWithInlineData::trace(visitor); |
| 765 ContextLifecycleObserver::trace(visitor); | 766 ContextLifecycleObserver::trace(visitor); |
| 766 visitor->trace(m_navigatorVR); | 767 visitor->trace(m_navigatorVR); |
| 767 visitor->trace(m_capabilities); | 768 visitor->trace(m_capabilities); |
| 768 visitor->trace(m_stageParameters); | 769 visitor->trace(m_stageParameters); |
| 769 visitor->trace(m_eyeParametersLeft); | 770 visitor->trace(m_eyeParametersLeft); |
| 770 visitor->trace(m_eyeParametersRight); | 771 visitor->trace(m_eyeParametersRight); |
| 771 visitor->trace(m_layer); | 772 visitor->trace(m_layer); |
| 772 visitor->trace(m_renderingContext); | 773 visitor->trace(m_renderingContext); |
| 773 visitor->trace(m_scriptedAnimationController); | 774 visitor->trace(m_scriptedAnimationController); |
| 774 visitor->trace(m_pendingPresentResolvers); | 775 visitor->trace(m_pendingPresentResolvers); |
| 775 } | 776 } |
| 776 | 777 |
| 777 } // namespace blink | 778 } // namespace blink |
| OLD | NEW |