Chromium Code Reviews| Index: third_party/WebKit/Source/platform/mediastream/MediaStreamSource.h |
| diff --git a/third_party/WebKit/Source/platform/mediastream/MediaStreamSource.h b/third_party/WebKit/Source/platform/mediastream/MediaStreamSource.h |
| index a7ab84147b152911bbaa6a7bd8268373cde98a62..7dc87f85756e490b529cdc53bf80970ec488d466 100644 |
| --- a/third_party/WebKit/Source/platform/mediastream/MediaStreamSource.h |
| +++ b/third_party/WebKit/Source/platform/mediastream/MediaStreamSource.h |
| @@ -44,9 +44,9 @@ |
| namespace blink { |
| -class PLATFORM_EXPORT MediaStreamSource final : public RefCounted<MediaStreamSource> { |
| +class PLATFORM_EXPORT MediaStreamSource final : public GarbageCollectedFinalized<MediaStreamSource> { |
| public: |
| - class PLATFORM_EXPORT Observer { |
| + class PLATFORM_EXPORT Observer : public GarbageCollectedMixin { |
| public: |
| virtual ~Observer() { } |
| virtual void sourceChangedState() = 0; |
| @@ -68,7 +68,7 @@ public: |
| ReadyStateEnded = 2 |
| }; |
| - static PassRefPtr<MediaStreamSource> create(const String& id, Type, const String& name, bool remote, bool readonly, ReadyState = ReadyStateLive, bool requiresConsumer = false); |
| + static MediaStreamSource* create(const String& id, Type, const String& name, bool remote, bool readonly, ReadyState = ReadyStateLive, bool requiresConsumer = false); |
| const String& id() const { return m_id; } |
| Type type() const { return m_type; } |
| @@ -96,6 +96,8 @@ public: |
| bool removeAudioConsumer(AudioDestinationConsumer*); |
| const HeapHashSet<Member<AudioDestinationConsumer>>& audioConsumers() { return m_audioConsumers; } |
| + DECLARE_TRACE(); |
|
sof
2015/09/30 09:27:34
Observers will take care of eagerly removing thems
peria
2015/10/01 09:11:53
Yes, we can assume removeAudioConsure() calls happ
sof
2015/10/01 18:54:05
To verify, when chasing around abstractions I know
|
| + |
| private: |
| MediaStreamSource(const String& id, Type, const String& name, bool remote, bool readonly, ReadyState, bool requiresConsumer); |
| @@ -106,14 +108,14 @@ private: |
| bool m_readonly; |
| ReadyState m_readyState; |
| bool m_requiresConsumer; |
| - Vector<Observer*> m_observers; |
| + HeapVector<Member<Observer>> m_observers; |
|
haraken
2015/10/02 02:27:15
Can we make this HeapHashSet<WeakMember<Observer>>
peria
2015/10/02 03:20:51
Done.
|
| Mutex m_audioConsumersLock; |
| - PersistentHeapHashSet<Member<AudioDestinationConsumer>> m_audioConsumers; |
| + HeapHashSet<Member<AudioDestinationConsumer>> m_audioConsumers; |
| OwnPtr<ExtraData> m_extraData; |
| WebMediaConstraints m_constraints; |
| }; |
| -typedef Vector<RefPtr<MediaStreamSource>> MediaStreamSourceVector; |
| +typedef HeapVector<Member<MediaStreamSource>> MediaStreamSourceVector; |
| } // namespace blink |