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 "config.h" | 5 #include "config.h" |
6 #include "modules/vr/VRGetDevicesCallback.h" | 6 #include "modules/vr/VRGetDevicesCallback.h" |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
9 #include "modules/vr/VRHardwareUnitCollection.h" | 9 #include "modules/vr/VRHardwareUnitCollection.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 VRGetDevicesCallback::VRGetDevicesCallback(PassRefPtrWillBeRawPtr<ScriptPromiseR
esolver> resolver, VRHardwareUnitCollection* hardwareUnits) | 13 VRGetDevicesCallback::VRGetDevicesCallback(ScriptPromiseResolver* resolver, VRHa
rdwareUnitCollection* hardwareUnits) |
14 : m_resolver(resolver) | 14 : m_resolver(resolver) |
15 , m_hardwareUnits(hardwareUnits) | 15 , m_hardwareUnits(hardwareUnits) |
16 { | 16 { |
17 } | 17 } |
18 | 18 |
19 VRGetDevicesCallback::~VRGetDevicesCallback() | 19 VRGetDevicesCallback::~VRGetDevicesCallback() |
20 { | 20 { |
21 } | 21 } |
22 | 22 |
23 void VRGetDevicesCallback::onSuccess(WebVector<WebVRDevice>* devices) | 23 void VRGetDevicesCallback::onSuccess(WebVector<WebVRDevice>* devices) |
24 { | 24 { |
25 m_resolver->resolve(m_hardwareUnits->updateVRHardwareUnits(devices)); | 25 m_resolver->resolve(m_hardwareUnits->updateVRHardwareUnits(devices)); |
26 } | 26 } |
27 | 27 |
28 void VRGetDevicesCallback::onError() | 28 void VRGetDevicesCallback::onError() |
29 { | 29 { |
30 m_resolver->reject(); | 30 m_resolver->reject(); |
31 } | 31 } |
32 | 32 |
33 } // namespace blink | 33 } // namespace blink |
OLD | NEW |