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 a266f43d9b194bc884955d27c1c2187d10041e79..be1f2f1a479fbd4b5c3086ebf6627fac67bca976 100644 |
| --- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
| +++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
| @@ -13,6 +13,7 @@ |
| #include "core/frame/UseCounter.h" |
| #include "core/inspector/ConsoleMessage.h" |
| #include "gpu/command_buffer/client/gles2_interface.h" |
| +#include "modules/EventTargetModules.h" |
| #include "modules/vr/NavigatorVR.h" |
| #include "modules/vr/VRController.h" |
| #include "modules/vr/VRDisplayCapabilities.h" |
| @@ -62,7 +63,9 @@ class VRDisplayFrameRequestCallback : public FrameRequestCallback { |
| VRDisplay::VRDisplay(NavigatorVR* navigatorVR, |
| device::mojom::blink::VRDisplayPtr display, |
| device::mojom::blink::VRDisplayClientRequest request) |
| - : m_navigatorVR(navigatorVR), |
| + : ActiveScriptWrappable(this), |
| + ActiveDOMObject(navigatorVR->document()), |
| + m_navigatorVR(navigatorVR), |
| m_isConnected(false), |
| m_isPresenting(false), |
| m_canUpdateFramePose(true), |
| @@ -666,7 +669,35 @@ void VRDisplay::dispose() { |
| m_binding.Close(); |
| } |
| +ExecutionContext* VRDisplay::getExecutionContext() const { |
| + return ContextLifecycleObserver::getExecutionContext(); |
|
bajones
2016/11/29 00:15:44
Seems more common in objects that derive from Acti
|
| +} |
| + |
| +const AtomicString& VRDisplay::interfaceName() const { |
| + return EventTargetNames::VRDisplay; |
| +} |
| + |
| +void VRDisplay::suspend() { |
| + // TODO(xing.xu): Implement suspend. |
| +} |
| + |
| +void VRDisplay::resume() { |
| + // TODO(xing.xu): Implement resume. |
| +} |
| + |
| +void VRDisplay::contextDestroyed() { |
| + // TODO(xing.xu): Implement destory. Such as forceExitPresent(). |
|
bajones
2016/11/29 00:15:44
Minor typo here ("destory" -> "destroy") but rathe
haraken
2016/11/29 01:43:28
If you're not sure what to do in contextDestroyed,
mlamouri (slow - plz ping)
2016/12/01 10:10:06
+1, it sounds that you dan't have a need for the o
|
| +} |
| + |
| +bool VRDisplay::hasPendingActivity() const { |
| + // Prevent V8 from garbage collecting the wrapper object if there are |
| + // event listeners attached to it. |
| + return hasEventListeners(); |
| +} |
| + |
| DEFINE_TRACE(VRDisplay) { |
| + EventTargetWithInlineData::trace(visitor); |
| + ActiveDOMObject::trace(visitor); |
| visitor->trace(m_navigatorVR); |
| visitor->trace(m_capabilities); |
| visitor->trace(m_stageParameters); |