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