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

Side by Side Diff: Source/modules/mediastream/MediaStream.h

Issue 173363002: Move mediastream module to oilpan transition types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: toRefPtrWillBeMemberNativeArray 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Ericsson AB. All rights reserved. 3 * Copyright (C) 2011 Ericsson AB. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
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 22 matching lines...) Expand all
33 #include "modules/mediastream/MediaStreamTrack.h" 33 #include "modules/mediastream/MediaStreamTrack.h"
34 #include "platform/Timer.h" 34 #include "platform/Timer.h"
35 #include "platform/mediastream/MediaStreamDescriptor.h" 35 #include "platform/mediastream/MediaStreamDescriptor.h"
36 #include "wtf/RefCounted.h" 36 #include "wtf/RefCounted.h"
37 #include "wtf/RefPtr.h" 37 #include "wtf/RefPtr.h"
38 38
39 namespace WebCore { 39 namespace WebCore {
40 40
41 class ExceptionState; 41 class ExceptionState;
42 42
43 class MediaStream FINAL : public RefCounted<MediaStream>, public ScriptWrappable , public URLRegistrable, public MediaStreamDescriptorClient, public EventTargetW ithInlineData, public ContextLifecycleObserver, public MediaStreamTrack::Observe r { 43 class MediaStream FINAL : public RefCountedWillBeRefCountedGarbageCollected<Medi aStream>, public ScriptWrappable, public URLRegistrable, public MediaStreamDescr iptorClient, public EventTargetWithInlineData, public ContextLifecycleObserver, public MediaStreamTrack::Observer {
44 REFCOUNTED_EVENT_TARGET(MediaStream); 44 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<M ediaStream>);
45 public: 45 public:
46 static PassRefPtr<MediaStream> create(ExecutionContext*); 46 static PassRefPtrWillBeRawPtr<MediaStream> create(ExecutionContext*);
47 static PassRefPtr<MediaStream> create(ExecutionContext*, PassRefPtr<MediaStr eam>); 47 static PassRefPtrWillBeRawPtr<MediaStream> create(ExecutionContext*, PassRef PtrWillBeRawPtr<MediaStream>);
48 static PassRefPtr<MediaStream> create(ExecutionContext*, const MediaStreamTr ackVector&); 48 static PassRefPtrWillBeRawPtr<MediaStream> create(ExecutionContext*, const M ediaStreamTrackVector&);
49 static PassRefPtr<MediaStream> create(ExecutionContext*, PassRefPtr<MediaStr eamDescriptor>); 49 static PassRefPtrWillBeRawPtr<MediaStream> create(ExecutionContext*, PassRef Ptr<MediaStreamDescriptor>);
50 virtual ~MediaStream(); 50 virtual ~MediaStream();
51 51
52 // DEPRECATED 52 // DEPRECATED
53 String label() const { return m_descriptor->id(); } 53 String label() const { return m_descriptor->id(); }
54 54
55 String id() const { return m_descriptor->id(); } 55 String id() const { return m_descriptor->id(); }
56 56
57 void addTrack(PassRefPtr<MediaStreamTrack>, ExceptionState&); 57 void addTrack(PassRefPtrWillBeRawPtr<MediaStreamTrack>, ExceptionState&);
58 void removeTrack(PassRefPtr<MediaStreamTrack>, ExceptionState&); 58 void removeTrack(PassRefPtrWillBeRawPtr<MediaStreamTrack>, ExceptionState&);
59 MediaStreamTrack* getTrackById(String); 59 MediaStreamTrack* getTrackById(String);
60 PassRefPtr<MediaStream> clone(ExecutionContext*); 60 PassRefPtrWillBeRawPtr<MediaStream> clone(ExecutionContext*);
61 61
62 MediaStreamTrackVector getAudioTracks() const { return m_audioTracks; } 62 MediaStreamTrackVector getAudioTracks() const { return m_audioTracks; }
63 MediaStreamTrackVector getVideoTracks() const { return m_videoTracks; } 63 MediaStreamTrackVector getVideoTracks() const { return m_videoTracks; }
64 64
65 bool ended() const; 65 bool ended() const;
66 void stop(); 66 void stop();
67 67
68 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended); 68 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended);
69 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); 69 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack);
70 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack); 70 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack);
71 71
72 // MediaStreamTrack::Observer 72 // MediaStreamTrack::Observer
73 virtual void trackEnded() OVERRIDE; 73 virtual void trackEnded() OVERRIDE;
74 74
75 // MediaStreamDescriptorClient 75 // MediaStreamDescriptorClient
76 virtual void streamEnded() OVERRIDE; 76 virtual void streamEnded() OVERRIDE;
77 77
78 MediaStreamDescriptor* descriptor() const { return m_descriptor.get(); } 78 MediaStreamDescriptor* descriptor() const { return m_descriptor.get(); }
79 79
80 // EventTarget 80 // EventTarget
81 virtual const AtomicString& interfaceName() const OVERRIDE; 81 virtual const AtomicString& interfaceName() const OVERRIDE;
82 virtual ExecutionContext* executionContext() const OVERRIDE; 82 virtual ExecutionContext* executionContext() const OVERRIDE;
83 83
84 // URLRegistrable 84 // URLRegistrable
85 virtual URLRegistry& registry() const OVERRIDE; 85 virtual URLRegistry& registry() const OVERRIDE;
86 86
87 void trace(Visitor*);
88
87 private: 89 private:
88 MediaStream(ExecutionContext*, PassRefPtr<MediaStreamDescriptor>); 90 MediaStream(ExecutionContext*, PassRefPtr<MediaStreamDescriptor>);
89 MediaStream(ExecutionContext*, const MediaStreamTrackVector& audioTracks, co nst MediaStreamTrackVector& videoTracks); 91 MediaStream(ExecutionContext*, const MediaStreamTrackVector& audioTracks, co nst MediaStreamTrackVector& videoTracks);
90 92
91 // ContextLifecycleObserver 93 // ContextLifecycleObserver
92 virtual void contextDestroyed() OVERRIDE; 94 virtual void contextDestroyed() OVERRIDE;
93 95
94 // MediaStreamDescriptorClient 96 // MediaStreamDescriptorClient
95 virtual void addRemoteTrack(MediaStreamComponent*) OVERRIDE; 97 virtual void addRemoteTrack(MediaStreamComponent*) OVERRIDE;
96 virtual void removeRemoteTrack(MediaStreamComponent*) OVERRIDE; 98 virtual void removeRemoteTrack(MediaStreamComponent*) OVERRIDE;
97 99
98 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); 100 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>);
99 void scheduledEventTimerFired(Timer<MediaStream>*); 101 void scheduledEventTimerFired(Timer<MediaStream>*);
100 102
101 bool m_stopped; 103 bool m_stopped;
102 104
103 MediaStreamTrackVector m_audioTracks; 105 MediaStreamTrackVector m_audioTracks;
104 MediaStreamTrackVector m_videoTracks; 106 MediaStreamTrackVector m_videoTracks;
105 RefPtr<MediaStreamDescriptor> m_descriptor; 107 RefPtr<MediaStreamDescriptor> m_descriptor;
106 108
107 Timer<MediaStream> m_scheduledEventTimer; 109 Timer<MediaStream> m_scheduledEventTimer;
108 WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; 110 WillBeHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents;
109 }; 111 };
110 112
111 typedef Vector<RefPtr<MediaStream> > MediaStreamVector; 113 typedef WillBeHeapVector<RefPtrWillBeMember<MediaStream> > MediaStreamVector;
112 114
113 } // namespace WebCore 115 } // namespace WebCore
114 116
115 #endif // MediaStream_h 117 #endif // MediaStream_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698