Chromium Code Reviews| 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 { | 43 class MediaStream FINAL : public RefCountedWillBeRefCountedGarbageCollected<Medi aStream>, public ScriptWrappable, public URLRegistrable, public MediaStreamDescr iptorClient, public EventTargetWithInlineData, public ContextLifecycleObserver { |
| 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 | 60 |
| 61 MediaStreamTrackVector getAudioTracks() const { return m_audioTracks; } | 61 MediaStreamTrackVector getAudioTracks() const { return m_audioTracks; } |
| 62 MediaStreamTrackVector getVideoTracks() const { return m_videoTracks; } | 62 MediaStreamTrackVector getVideoTracks() const { return m_videoTracks; } |
| 63 | 63 |
| 64 bool ended() const; | 64 bool ended() const; |
| 65 void stop(); | 65 void stop(); |
| 66 | 66 |
| 67 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended); | 67 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended); |
| 68 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); | 68 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); |
| 69 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack); | 69 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack); |
| 70 | 70 |
| 71 // MediaStreamDescriptorClient | 71 // MediaStreamDescriptorClient |
| 72 virtual void trackEnded() OVERRIDE; | 72 virtual void trackEnded() OVERRIDE; |
| 73 virtual void streamEnded() OVERRIDE; | 73 virtual void streamEnded() OVERRIDE; |
| 74 | 74 |
| 75 MediaStreamDescriptor* descriptor() const { return m_descriptor.get(); } | 75 MediaStreamDescriptor* descriptor() const { return m_descriptor.get(); } |
| 76 | 76 |
| 77 // EventTarget | 77 // EventTarget |
| 78 virtual const AtomicString& interfaceName() const OVERRIDE; | 78 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 79 virtual ExecutionContext* executionContext() const OVERRIDE; | 79 virtual ExecutionContext* executionContext() const OVERRIDE; |
| 80 | 80 |
| 81 // URLRegistrable | 81 // URLRegistrable |
| 82 virtual URLRegistry& registry() const OVERRIDE; | 82 virtual URLRegistry& registry() const OVERRIDE; |
| 83 | 83 |
| 84 void trace(Visitor*) { } | |
| 85 | |
| 84 protected: | 86 protected: |
| 85 MediaStream(ExecutionContext*, PassRefPtr<MediaStreamDescriptor>); | 87 MediaStream(ExecutionContext*, PassRefPtr<MediaStreamDescriptor>); |
| 86 | 88 |
| 87 // ContextLifecycleObserver | 89 // ContextLifecycleObserver |
| 88 virtual void contextDestroyed() OVERRIDE; | 90 virtual void contextDestroyed() OVERRIDE; |
| 89 | 91 |
| 90 private: | 92 private: |
| 91 // MediaStreamDescriptorClient | 93 // MediaStreamDescriptorClient |
| 92 virtual void addRemoteTrack(MediaStreamComponent*) OVERRIDE; | 94 virtual void addRemoteTrack(MediaStreamComponent*) OVERRIDE; |
| 93 virtual void removeRemoteTrack(MediaStreamComponent*) OVERRIDE; | 95 virtual void removeRemoteTrack(MediaStreamComponent*) OVERRIDE; |
| 94 | 96 |
| 95 void scheduleDispatchEvent(PassRefPtr<Event>); | 97 void scheduleDispatchEvent(PassRefPtr<Event>); |
| 96 void scheduledEventTimerFired(Timer<MediaStream>*); | 98 void scheduledEventTimerFired(Timer<MediaStream>*); |
| 97 | 99 |
| 98 bool m_stopped; | 100 bool m_stopped; |
| 99 | 101 |
| 100 MediaStreamTrackVector m_audioTracks; | 102 MediaStreamTrackVector m_audioTracks; |
|
haraken
2014/02/27 15:32:43
You need to trace |m_audioTracks|. Typedefs make u
keishi
2014/04/07 09:06:52
Done.
| |
| 101 MediaStreamTrackVector m_videoTracks; | 103 MediaStreamTrackVector m_videoTracks; |
|
haraken
2014/02/27 15:32:43
You need to trace |m_videoTracks|.
keishi
2014/04/07 09:06:52
Done.
| |
| 102 RefPtr<MediaStreamDescriptor> m_descriptor; | 104 RefPtr<MediaStreamDescriptor> m_descriptor; |
| 103 | 105 |
| 104 Timer<MediaStream> m_scheduledEventTimer; | 106 Timer<MediaStream> m_scheduledEventTimer; |
| 105 Vector<RefPtr<Event> > m_scheduledEvents; | 107 Vector<RefPtr<Event> > m_scheduledEvents; |
| 106 }; | 108 }; |
| 107 | 109 |
| 108 typedef Vector<RefPtr<MediaStream> > MediaStreamVector; | 110 typedef WillBeHeapVector<RefPtrWillBeMember<MediaStream> > MediaStreamVector; |
| 109 | 111 |
| 110 } // namespace WebCore | 112 } // namespace WebCore |
| 111 | 113 |
| 112 #endif // MediaStream_h | 114 #endif // MediaStream_h |
| OLD | NEW |