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/frame/LocalFrame.h" | 7 #include "core/frame/LocalFrame.h" |
8 #include "modules/vr/VRGetDevicesCallback.h" | 8 #include "modules/vr/VRGetDevicesCallback.h" |
9 #include "platform/RuntimeEnabledFeatures.h" | 9 #include "platform/RuntimeEnabledFeatures.h" |
10 #include "platform/mojo/MojoHelper.h" | 10 #include "platform/mojo/MojoHelper.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 } | 40 } |
41 | 41 |
42 void VRController::getDisplays(std::unique_ptr<VRGetDevicesCallback> callback) | 42 void VRController::getDisplays(std::unique_ptr<VRGetDevicesCallback> callback) |
43 { | 43 { |
44 if (!m_service) { | 44 if (!m_service) { |
45 callback->onError(); | 45 callback->onError(); |
46 return; | 46 return; |
47 } | 47 } |
48 | 48 |
49 m_pendingGetDevicesCallbacks.append(std::move(callback)); | 49 m_pendingGetDevicesCallbacks.append(std::move(callback)); |
50 m_service->GetDisplays(createBaseCallback(bind(&VRController::onGetDisplays,
wrapPersistent(this)))); | 50 m_service->GetDisplays(createBaseCallback(WTF::bind(&VRController::onGetDisp
lays, wrapPersistent(this)))); |
51 } | 51 } |
52 | 52 |
53 device::blink::VRPosePtr VRController::getPose(unsigned index) | 53 device::blink::VRPosePtr VRController::getPose(unsigned index) |
54 { | 54 { |
55 if (!m_service) | 55 if (!m_service) |
56 return nullptr; | 56 return nullptr; |
57 | 57 |
58 device::blink::VRPosePtr pose; | 58 device::blink::VRPosePtr pose; |
59 m_service->GetPose(index, &pose); | 59 m_service->GetPose(index, &pose); |
60 return pose; | 60 return pose; |
(...skipping 20 matching lines...) Expand all Loading... |
81 callback->onSuccess(std::move(displays)); | 81 callback->onSuccess(std::move(displays)); |
82 } | 82 } |
83 | 83 |
84 DEFINE_TRACE(VRController) | 84 DEFINE_TRACE(VRController) |
85 { | 85 { |
86 Supplement<LocalFrame>::trace(visitor); | 86 Supplement<LocalFrame>::trace(visitor); |
87 LocalFrameLifecycleObserver::trace(visitor); | 87 LocalFrameLifecycleObserver::trace(visitor); |
88 } | 88 } |
89 | 89 |
90 } // namespace blink | 90 } // namespace blink |
OLD | NEW |