Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "platform/mediastream/MediaStreamSource.h" | 31 #include "platform/mediastream/MediaStreamSource.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | |
| 35 MediaStreamSource* MediaStreamSource::create(const String& id, | 34 MediaStreamSource* MediaStreamSource::create(const String& id, |
|
mcasas
2016/10/17 18:08:25
Bring back l.34 from the LHS.
| |
| 36 StreamType type, | 35 StreamType type, |
| 37 const String& name, | 36 const String& name, |
| 38 bool remote, | |
| 39 ReadyState readyState, | 37 ReadyState readyState, |
| 40 bool requiresConsumer) { | 38 bool requiresConsumer) { |
| 41 return new MediaStreamSource(id, type, name, remote, readyState, | 39 return new MediaStreamSource(id, type, name, readyState, requiresConsumer); |
| 42 requiresConsumer); | |
| 43 } | 40 } |
| 44 | 41 |
| 45 MediaStreamSource::MediaStreamSource(const String& id, | 42 MediaStreamSource::MediaStreamSource(const String& id, |
| 46 StreamType type, | 43 StreamType type, |
| 47 const String& name, | 44 const String& name, |
| 48 bool remote, | |
| 49 ReadyState readyState, | 45 ReadyState readyState, |
| 50 bool requiresConsumer) | 46 bool requiresConsumer) |
| 51 : m_id(id), | 47 : m_id(id), |
| 52 m_type(type), | 48 m_type(type), |
| 53 m_name(name), | 49 m_name(name), |
| 54 m_remote(remote), | |
| 55 m_readyState(readyState), | 50 m_readyState(readyState), |
| 56 m_requiresConsumer(requiresConsumer) {} | 51 m_requiresConsumer(requiresConsumer) {} |
| 57 | 52 |
| 58 void MediaStreamSource::setReadyState(ReadyState readyState) { | 53 void MediaStreamSource::setReadyState(ReadyState readyState) { |
| 59 if (m_readyState != ReadyStateEnded && m_readyState != readyState) { | 54 if (m_readyState != ReadyStateEnded && m_readyState != readyState) { |
| 60 m_readyState = readyState; | 55 m_readyState = readyState; |
| 61 | 56 |
| 62 // Observers may dispatch events which create and add new Observers; | 57 // Observers may dispatch events which create and add new Observers; |
| 63 // take a snapshot so as to safely iterate. | 58 // take a snapshot so as to safely iterate. |
| 64 HeapVector<Member<Observer>> observers; | 59 HeapVector<Member<Observer>> observers; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 it != m_audioConsumers.end(); ++it) | 103 it != m_audioConsumers.end(); ++it) |
| 109 (*it)->consumeAudio(bus, numberOfFrames); | 104 (*it)->consumeAudio(bus, numberOfFrames); |
| 110 } | 105 } |
| 111 | 106 |
| 112 DEFINE_TRACE(MediaStreamSource) { | 107 DEFINE_TRACE(MediaStreamSource) { |
| 113 visitor->trace(m_observers); | 108 visitor->trace(m_observers); |
| 114 visitor->trace(m_audioConsumers); | 109 visitor->trace(m_audioConsumers); |
| 115 } | 110 } |
| 116 | 111 |
| 117 } // namespace blink | 112 } // namespace blink |
| OLD | NEW |