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

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: Rebased Created 6 years, 7 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
« no previous file with comments | « Source/modules/mediastream/MediaStream.idl ('k') | Source/modules/mediastream/MediaStreamTrack.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/mediastream/MediaStreamTrack.h
diff --git a/Source/modules/mediastream/MediaStreamTrack.h b/Source/modules/mediastream/MediaStreamTrack.h
index af79c06c575f3db6a5c1eee80af9e29c26e7e2be..57a7dc28001cf4be5980c1142c54467c3a537d21 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<RawPtrWillBeMember<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
« no previous file with comments | « Source/modules/mediastream/MediaStream.idl ('k') | Source/modules/mediastream/MediaStreamTrack.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698