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 28 matching lines...) Expand all Loading... |
39 } | 39 } |
40 | 40 |
41 MediaStreamSource::MediaStreamSource(const String& id, StreamType type, const St
ring& name, bool remote, ReadyState readyState, bool requiresConsumer) | 41 MediaStreamSource::MediaStreamSource(const String& id, StreamType type, const St
ring& name, bool remote, ReadyState readyState, bool requiresConsumer) |
42 : m_id(id) | 42 : m_id(id) |
43 , m_type(type) | 43 , m_type(type) |
44 , m_name(name) | 44 , m_name(name) |
45 , m_remote(remote) | 45 , m_remote(remote) |
46 , m_readyState(readyState) | 46 , m_readyState(readyState) |
47 , m_requiresConsumer(requiresConsumer) | 47 , m_requiresConsumer(requiresConsumer) |
48 { | 48 { |
49 ThreadState::current()->registerPreFinalizer(this); | |
50 } | |
51 | |
52 void MediaStreamSource::dispose() | |
53 { | |
54 m_extraData.reset(); | |
55 } | 49 } |
56 | 50 |
57 void MediaStreamSource::setReadyState(ReadyState readyState) | 51 void MediaStreamSource::setReadyState(ReadyState readyState) |
58 { | 52 { |
59 if (m_readyState != ReadyStateEnded && m_readyState != readyState) { | 53 if (m_readyState != ReadyStateEnded && m_readyState != readyState) { |
60 m_readyState = readyState; | 54 m_readyState = readyState; |
61 | 55 |
62 // Observers may dispatch events which create and add new Observers; | 56 // Observers may dispatch events which create and add new Observers; |
63 // take a snapshot so as to safely iterate. | 57 // take a snapshot so as to safely iterate. |
64 HeapVector<Member<Observer>> observers; | 58 HeapVector<Member<Observer>> observers; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 (*it)->consumeAudio(bus, numberOfFrames); | 101 (*it)->consumeAudio(bus, numberOfFrames); |
108 } | 102 } |
109 | 103 |
110 DEFINE_TRACE(MediaStreamSource) | 104 DEFINE_TRACE(MediaStreamSource) |
111 { | 105 { |
112 visitor->trace(m_observers); | 106 visitor->trace(m_observers); |
113 visitor->trace(m_audioConsumers); | 107 visitor->trace(m_audioConsumers); |
114 } | 108 } |
115 | 109 |
116 } // namespace blink | 110 } // namespace blink |
OLD | NEW |