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

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

Issue 2167643003: Refactored VRService interaction and added VRServiceClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Liberal sprinkling of 'u's Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
diff --git a/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp b/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
index c8e9b7219b0622d9eee84e75965f0e6a9f4d78e6..f400ceeb49a1c8fef85de4e9d101bf2e4fa4be0f 100644
--- a/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
+++ b/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
@@ -14,7 +14,6 @@
#include "core/page/Page.h"
#include "modules/vr/VRController.h"
#include "modules/vr/VRDisplay.h"
-#include "modules/vr/VRDisplayCollection.h"
#include "modules/vr/VRGetDevicesCallback.h"
#include "modules/vr/VRPose.h"
#include "wtf/PtrUtil.h"
@@ -57,7 +56,7 @@ ScriptPromise NavigatorVR::getVRDisplays(ScriptState* scriptState)
return promise;
}
- controller()->getDisplays(WTF::wrapUnique(new VRGetDevicesCallback(resolver, m_displays.get())));
+ controller()->getDisplays(resolver);
return promise;
}
@@ -67,7 +66,11 @@ VRController* NavigatorVR::controller()
if (!frame())
return 0;
- return VRController::from(*frame());
+ if (!m_controller) {
+ m_controller = new VRController(this);
+ }
+
+ return m_controller;
}
Document* NavigatorVR::document()
@@ -77,7 +80,7 @@ Document* NavigatorVR::document()
DEFINE_TRACE(NavigatorVR)
{
- visitor->trace(m_displays);
+ visitor->trace(m_controller);
Supplement<Navigator>::trace(visitor);
DOMWindowProperty::trace(visitor);
@@ -86,7 +89,6 @@ DEFINE_TRACE(NavigatorVR)
NavigatorVR::NavigatorVR(LocalFrame* frame)
: DOMWindowProperty(frame)
{
- m_displays = new VRDisplayCollection(this);
}
NavigatorVR::~NavigatorVR()
« no previous file with comments | « third_party/WebKit/Source/modules/vr/NavigatorVR.h ('k') | third_party/WebKit/Source/modules/vr/VRController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698