OLD | NEW |
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 Loading... |
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 REFCOUNTED_EVENT_TARGET(MediaStream); |
| 45 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaStream); |
45 public: | 46 public: |
46 static PassRefPtr<MediaStream> create(ExecutionContext*); | 47 static PassRefPtr<MediaStream> create(ExecutionContext*); |
47 static PassRefPtr<MediaStream> create(ExecutionContext*, PassRefPtr<MediaStr
eam>); | 48 static PassRefPtr<MediaStream> create(ExecutionContext*, PassRefPtr<MediaStr
eam>); |
48 static PassRefPtr<MediaStream> create(ExecutionContext*, const MediaStreamTr
ackVector&); | 49 static PassRefPtr<MediaStream> create(ExecutionContext*, const MediaStreamTr
ackVector&); |
49 static PassRefPtr<MediaStream> create(ExecutionContext*, PassRefPtr<MediaStr
eamDescriptor>); | 50 static PassRefPtr<MediaStream> create(ExecutionContext*, PassRefPtr<MediaStr
eamDescriptor>); |
50 virtual ~MediaStream(); | 51 virtual ~MediaStream(); |
51 | 52 |
52 // DEPRECATED | 53 // DEPRECATED |
53 String label() const { return m_descriptor->id(); } | 54 String label() const { return m_descriptor->id(); } |
54 | 55 |
(...skipping 22 matching lines...) Expand all Loading... |
77 | 78 |
78 MediaStreamDescriptor* descriptor() const { return m_descriptor.get(); } | 79 MediaStreamDescriptor* descriptor() const { return m_descriptor.get(); } |
79 | 80 |
80 // EventTarget | 81 // EventTarget |
81 virtual const AtomicString& interfaceName() const OVERRIDE; | 82 virtual const AtomicString& interfaceName() const OVERRIDE; |
82 virtual ExecutionContext* executionContext() const OVERRIDE; | 83 virtual ExecutionContext* executionContext() const OVERRIDE; |
83 | 84 |
84 // URLRegistrable | 85 // URLRegistrable |
85 virtual URLRegistry& registry() const OVERRIDE; | 86 virtual URLRegistry& registry() const OVERRIDE; |
86 | 87 |
| 88 virtual void trace(Visitor*) OVERRIDE; |
| 89 |
87 private: | 90 private: |
88 MediaStream(ExecutionContext*, PassRefPtr<MediaStreamDescriptor>); | 91 MediaStream(ExecutionContext*, PassRefPtr<MediaStreamDescriptor>); |
89 MediaStream(ExecutionContext*, const MediaStreamTrackVector& audioTracks, co
nst MediaStreamTrackVector& videoTracks); | 92 MediaStream(ExecutionContext*, const MediaStreamTrackVector& audioTracks, co
nst MediaStreamTrackVector& videoTracks); |
90 | 93 |
91 // ContextLifecycleObserver | 94 // ContextLifecycleObserver |
92 virtual void contextDestroyed() OVERRIDE; | 95 virtual void contextDestroyed() OVERRIDE; |
93 | 96 |
94 // MediaStreamDescriptorClient | 97 // MediaStreamDescriptorClient |
95 virtual void addRemoteTrack(MediaStreamComponent*) OVERRIDE; | 98 virtual void addRemoteTrack(MediaStreamComponent*) OVERRIDE; |
96 virtual void removeRemoteTrack(MediaStreamComponent*) OVERRIDE; | 99 virtual void removeRemoteTrack(MediaStreamComponent*) OVERRIDE; |
97 | 100 |
98 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); | 101 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); |
99 void scheduledEventTimerFired(Timer<MediaStream>*); | 102 void scheduledEventTimerFired(Timer<MediaStream>*); |
100 | 103 |
101 bool m_stopped; | 104 bool m_stopped; |
102 | 105 |
103 MediaStreamTrackVector m_audioTracks; | 106 MediaStreamTrackVector m_audioTracks; |
104 MediaStreamTrackVector m_videoTracks; | 107 MediaStreamTrackVector m_videoTracks; |
105 RefPtr<MediaStreamDescriptor> m_descriptor; | 108 RefPtr<MediaStreamDescriptor> m_descriptor; |
106 | 109 |
107 Timer<MediaStream> m_scheduledEventTimer; | 110 Timer<MediaStream> m_scheduledEventTimer; |
108 WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; | 111 WillBeHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; |
109 }; | 112 }; |
110 | 113 |
111 typedef Vector<RefPtr<MediaStream> > MediaStreamVector; | 114 typedef Vector<RefPtr<MediaStream> > MediaStreamVector; |
112 | 115 |
113 } // namespace WebCore | 116 } // namespace WebCore |
114 | 117 |
115 #endif // MediaStream_h | 118 #endif // MediaStream_h |
OLD | NEW |