Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: Source/modules/mediastream/MediaStreamTrack.h

Issue 173363002: Move mediastream module to oilpan transition types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/mediastream/MediaStreamTrack.h
diff --git a/Source/modules/mediastream/MediaStreamTrack.h b/Source/modules/mediastream/MediaStreamTrack.h
index 40347d006b4b56b2f069956f833a9f2cee161ea7..6ff41c8f571b49fb723a11b80473f9ea0906216a 100644
--- a/Source/modules/mediastream/MediaStreamTrack.h
+++ b/Source/modules/mediastream/MediaStreamTrack.h
@@ -45,16 +45,10 @@ class ExceptionState;
class MediaStreamComponent;
class MediaStreamTrackSourcesCallback;
-class MediaStreamTrack FINAL : public RefCounted<MediaStreamTrack>, public ScriptWrappable, public ActiveDOMObject, public EventTargetWithInlineData, public MediaStreamSource::Observer {
- REFCOUNTED_EVENT_TARGET(MediaStreamTrack);
+class MediaStreamTrack FINAL : public RefCountedWillBeRefCountedGarbageCollected<MediaStreamTrack>, public ScriptWrappable, public ActiveDOMObject, public EventTargetWithInlineData, public MediaStreamSource::Observer {
+ DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<MediaStreamTrack>);
public:
- class Observer {
- public:
- virtual ~Observer() { }
- virtual void trackEnded() = 0;
- };
-
- static PassRefPtr<MediaStreamTrack> create(ExecutionContext*, MediaStreamComponent*);
+ static PassRefPtrWillBeRawPtr<MediaStreamTrack> create(ExecutionContext*, MediaStreamComponent*);
virtual ~MediaStreamTrack();
String kind() const;
@@ -68,7 +62,7 @@ public:
static void getSources(ExecutionContext*, PassOwnPtr<MediaStreamTrackSourcesCallback>, ExceptionState&);
void stopTrack(ExceptionState&);
- PassRefPtr<MediaStreamTrack> clone(ExecutionContext*);
+ PassRefPtrWillBeRawPtr<MediaStreamTrack> clone(ExecutionContext*);
DEFINE_ATTRIBUTE_EVENT_LISTENER(mute);
DEFINE_ATTRIBUTE_EVENT_LISTENER(unmute);
@@ -77,8 +71,8 @@ public:
MediaStreamComponent* component();
bool ended() const;
- void addObserver(Observer*);
- void removeObserver(Observer*);
+ void registerMediaStream(MediaStream*);
+ void unregisterMediaStream(MediaStream*);
// EventTarget
virtual const AtomicString& interfaceName() const OVERRIDE;
@@ -89,6 +83,8 @@ public:
PassOwnPtr<AudioSourceProvider> createWebAudioSource();
+ void trace(Visitor*);
+
private:
MediaStreamTrack(ExecutionContext*, MediaStreamComponent*);
@@ -98,14 +94,14 @@ private:
virtual void sourceChangedState() OVERRIDE;
void propagateTrackEnded();
- Vector<Observer*> m_observers;
- bool m_isIteratingObservers;
+ WillBeHeapHashSet<RawPtrWillBeWeakMember<MediaStream> > m_registeredMediaStreams;
+ bool m_isIteratingRegisteredMediaStreams;
bool m_stopped;
RefPtr<MediaStreamComponent> m_component;
};
-typedef Vector<RefPtr<MediaStreamTrack> > MediaStreamTrackVector;
+typedef WillBeHeapVector<RefPtrWillBeMember<MediaStreamTrack> > MediaStreamTrackVector;
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698