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

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

Issue 2603553002: Ports VRService to be hosted in the device service.
Patch Set: Ports VRService to be hosted in the device service. Created 3 years, 12 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/Source/modules/vr/DEPS ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/VRController.h" 5 #include "modules/vr/VRController.h"
6 6
7 #include "bindings/core/v8/ScriptPromiseResolver.h" 7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "core/dom/DOMException.h" 8 #include "core/dom/DOMException.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
11 #include "modules/vr/NavigatorVR.h" 11 #include "modules/vr/NavigatorVR.h"
12 #include "modules/vr/VRGetDevicesCallback.h" 12 #include "modules/vr/VRGetDevicesCallback.h"
13 #include "public/platform/InterfaceProvider.h" 13 #include "platform/ServiceConnector.h"
14 #include "services/device/public/interfaces/constants.mojom-blink.h"
14 15
15 #include "wtf/Assertions.h" 16 #include "wtf/Assertions.h"
16 17
17 namespace blink { 18 namespace blink {
18 19
19 VRController::VRController(NavigatorVR* navigatorVR) 20 VRController::VRController(NavigatorVR* navigatorVR)
20 : ContextLifecycleObserver(navigatorVR->document()), 21 : ContextLifecycleObserver(navigatorVR->document()),
21 m_navigatorVR(navigatorVR), 22 m_navigatorVR(navigatorVR),
22 m_displaySynced(false), 23 m_displaySynced(false),
23 m_binding(this) { 24 m_binding(this) {
24 navigatorVR->document()->frame()->interfaceProvider()->getInterface( 25 ServiceConnector::instance().connectToInterface(
blundell 2017/01/12 09:59:56 Brandon, do you know this interface was exposed at
25 mojo::MakeRequest(&m_service)); 26 device::mojom::blink::kServiceName, mojo::MakeRequest(&m_service));
26 m_service->SetClient( 27 m_service->SetClient(
27 m_binding.CreateInterfacePtrAndBind(), 28 m_binding.CreateInterfacePtrAndBind(),
28 convertToBaseCallback( 29 convertToBaseCallback(
29 WTF::bind(&VRController::onDisplaysSynced, wrapPersistent(this)))); 30 WTF::bind(&VRController::onDisplaysSynced, wrapPersistent(this))));
30 } 31 }
31 32
32 VRController::~VRController() {} 33 VRController::~VRController() {}
33 34
34 void VRController::getDisplays(ScriptPromiseResolver* resolver) { 35 void VRController::getDisplays(ScriptPromiseResolver* resolver) {
35 if (!m_service) { 36 if (!m_service) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 110 }
110 111
111 DEFINE_TRACE(VRController) { 112 DEFINE_TRACE(VRController) {
112 visitor->trace(m_navigatorVR); 113 visitor->trace(m_navigatorVR);
113 visitor->trace(m_displays); 114 visitor->trace(m_displays);
114 115
115 ContextLifecycleObserver::trace(visitor); 116 ContextLifecycleObserver::trace(visitor);
116 } 117 }
117 118
118 } // namespace blink 119 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/vr/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698