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

Unified Diff: third_party/WebKit/Source/modules/vr/VRDisplay.cpp

Issue 2534543002: VRDisplay inherits from EventTarget (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698