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

Side by Side Diff: third_party/WebKit/Source/modules/vr/VRDisplay.cpp

Issue 2622943002: Fix WebVR requestAnimationFrame leaking (Closed)
Patch Set: Rebase to see if CQ failure fixed 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/vr/requestAnimationFrame_unregister.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/vr/requestAnimationFrame_unregister.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698