OLD | NEW |
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 "core/dom/DOMException.h" | 7 #include "core/dom/DOMException.h" |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
10 #include "modules/vr/NavigatorVR.h" | 10 #include "modules/vr/NavigatorVR.h" |
11 #include "modules/vr/VRGetDevicesCallback.h" | 11 #include "modules/vr/VRGetDevicesCallback.h" |
12 #include "public/platform/ServiceRegistry.h" | 12 #include "public/platform/InterfaceProvider.h" |
13 | 13 |
14 #include "wtf/Assertions.h" | 14 #include "wtf/Assertions.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
18 VRController::VRController(NavigatorVR* navigatorVR) | 18 VRController::VRController(NavigatorVR* navigatorVR) |
19 : ContextLifecycleObserver(navigatorVR->document()) | 19 : ContextLifecycleObserver(navigatorVR->document()) |
20 , m_navigatorVR(navigatorVR) | 20 , m_navigatorVR(navigatorVR) |
21 , m_binding(this) | 21 , m_binding(this) |
22 { | 22 { |
23 navigatorVR->document()->frame()->serviceRegistry()->connectToRemoteService(
mojo::GetProxy(&m_service)); | 23 navigatorVR->document()->frame()->interfaceProvider()->getInterface(mojo::Ge
tProxy(&m_service)); |
24 m_service->SetClient(m_binding.CreateInterfacePtrAndBind()); | 24 m_service->SetClient(m_binding.CreateInterfacePtrAndBind()); |
25 } | 25 } |
26 | 26 |
27 VRController::~VRController() | 27 VRController::~VRController() |
28 { | 28 { |
29 } | 29 } |
30 | 30 |
31 void VRController::getDisplays(ScriptPromiseResolver* resolver) | 31 void VRController::getDisplays(ScriptPromiseResolver* resolver) |
32 { | 32 { |
33 if (!m_service) { | 33 if (!m_service) { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 DEFINE_TRACE(VRController) | 129 DEFINE_TRACE(VRController) |
130 { | 130 { |
131 visitor->trace(m_navigatorVR); | 131 visitor->trace(m_navigatorVR); |
132 visitor->trace(m_displays); | 132 visitor->trace(m_displays); |
133 | 133 |
134 ContextLifecycleObserver::trace(visitor); | 134 ContextLifecycleObserver::trace(visitor); |
135 } | 135 } |
136 | 136 |
137 } // namespace blink | 137 } // namespace blink |
OLD | NEW |