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/VRGetDevicesCallback.h" | 5 #include "modules/vr/VRGetDevicesCallback.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 7 #include "bindings/core/v8/ScriptPromiseResolver.h" |
8 #include "modules/vr/VRDisplayCollection.h" | |
9 | 8 |
10 namespace blink { | 9 namespace blink { |
11 | 10 |
12 VRGetDevicesCallback::VRGetDevicesCallback(ScriptPromiseResolver* resolver, VRDi
splayCollection* displays) | 11 VRGetDevicesCallback::VRGetDevicesCallback(ScriptPromiseResolver* resolver) |
13 : m_resolver(resolver) | 12 : m_resolver(resolver) |
14 , m_displays(displays) | |
15 { | 13 { |
16 } | 14 } |
17 | 15 |
18 VRGetDevicesCallback::~VRGetDevicesCallback() | 16 VRGetDevicesCallback::~VRGetDevicesCallback() |
19 { | 17 { |
20 } | 18 } |
21 | 19 |
22 void VRGetDevicesCallback::onSuccess(mojo::WTFArray<device::blink::VRDisplayPtr>
displays) | 20 void VRGetDevicesCallback::onSuccess(VRDisplayVector displays) |
23 { | 21 { |
24 m_resolver->resolve(m_displays->updateDisplays(std::move(displays))); | 22 m_resolver->resolve(displays); |
25 } | 23 } |
26 | 24 |
27 void VRGetDevicesCallback::onError() | 25 void VRGetDevicesCallback::onError() |
28 { | 26 { |
29 m_resolver->reject(); | 27 m_resolver->reject(); |
30 } | 28 } |
31 | 29 |
32 } // namespace blink | 30 } // namespace blink |
OLD | NEW |