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/audio_output_devices/SetSinkIdCallbacks.h" | 5 #include "modules/audio_output_devices/SetSinkIdCallbacks.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 7 #include "bindings/core/v8/ScriptPromiseResolver.h" |
8 #include "modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.h" | 8 #include "modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 26 matching lines...) Loading... |
37 { | 37 { |
38 ASSERT(m_resolver); | 38 ASSERT(m_resolver); |
39 } | 39 } |
40 | 40 |
41 SetSinkIdCallbacks::~SetSinkIdCallbacks() | 41 SetSinkIdCallbacks::~SetSinkIdCallbacks() |
42 { | 42 { |
43 } | 43 } |
44 | 44 |
45 void SetSinkIdCallbacks::onSuccess() | 45 void SetSinkIdCallbacks::onSuccess() |
46 { | 46 { |
47 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ
eDOMObjectsAreStopped()) | 47 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()-
>activeDOMObjectsAreStopped()) |
48 return; | 48 return; |
49 | 49 |
50 HTMLMediaElementAudioOutputDevice& aodElement = HTMLMediaElementAudioOutputD
evice::from(*m_element); | 50 HTMLMediaElementAudioOutputDevice& aodElement = HTMLMediaElementAudioOutputD
evice::from(*m_element); |
51 aodElement.setSinkId(m_sinkId); | 51 aodElement.setSinkId(m_sinkId); |
52 m_resolver->resolve(); | 52 m_resolver->resolve(); |
53 } | 53 } |
54 | 54 |
55 void SetSinkIdCallbacks::onError(WebSetSinkIdError error) | 55 void SetSinkIdCallbacks::onError(WebSetSinkIdError error) |
56 { | 56 { |
57 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ
eDOMObjectsAreStopped()) | 57 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()-
>activeDOMObjectsAreStopped()) |
58 return; | 58 return; |
59 | 59 |
60 m_resolver->reject(ToException(error)); | 60 m_resolver->reject(ToException(error)); |
61 } | 61 } |
62 | 62 |
63 } // namespace blink | 63 } // namespace blink |
OLD | NEW |