| 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 19 matching lines...) Expand all Loading... |
| 30 #include "core/html/URLRegistry.h" | 30 #include "core/html/URLRegistry.h" |
| 31 #include "modules/EventTargetModules.h" | 31 #include "modules/EventTargetModules.h" |
| 32 #include "modules/mediastream/MediaStreamTrack.h" | 32 #include "modules/mediastream/MediaStreamTrack.h" |
| 33 #include "platform/Timer.h" | 33 #include "platform/Timer.h" |
| 34 #include "platform/mediastream/MediaStreamDescriptor.h" | 34 #include "platform/mediastream/MediaStreamDescriptor.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class ExceptionState; | 38 class ExceptionState; |
| 39 | 39 |
| 40 class MediaStream FINAL | 40 class MediaStream final |
| 41 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<MediaStre
am> | 41 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<MediaStre
am> |
| 42 , public URLRegistrable | 42 , public URLRegistrable |
| 43 , public MediaStreamDescriptorClient | 43 , public MediaStreamDescriptorClient |
| 44 , public EventTargetWithInlineData | 44 , public EventTargetWithInlineData |
| 45 , public ContextLifecycleObserver { | 45 , public ContextLifecycleObserver { |
| 46 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollectedWi
llBeGarbageCollectedFinalized<MediaStream>); | 46 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollectedWi
llBeGarbageCollectedFinalized<MediaStream>); |
| 47 DEFINE_WRAPPERTYPEINFO(); | 47 DEFINE_WRAPPERTYPEINFO(); |
| 48 USING_GARBAGE_COLLECTED_MIXIN(MediaStream); | 48 USING_GARBAGE_COLLECTED_MIXIN(MediaStream); |
| 49 public: | 49 public: |
| 50 static MediaStream* create(ExecutionContext*); | 50 static MediaStream* create(ExecutionContext*); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 70 bool ended() const; | 70 bool ended() const; |
| 71 void stop(); | 71 void stop(); |
| 72 | 72 |
| 73 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended); | 73 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended); |
| 74 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); | 74 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); |
| 75 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack); | 75 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack); |
| 76 | 76 |
| 77 void trackEnded(); | 77 void trackEnded(); |
| 78 | 78 |
| 79 // MediaStreamDescriptorClient | 79 // MediaStreamDescriptorClient |
| 80 virtual void streamEnded() OVERRIDE; | 80 virtual void streamEnded() override; |
| 81 | 81 |
| 82 MediaStreamDescriptor* descriptor() const { return m_descriptor.get(); } | 82 MediaStreamDescriptor* descriptor() const { return m_descriptor.get(); } |
| 83 | 83 |
| 84 // EventTarget | 84 // EventTarget |
| 85 virtual const AtomicString& interfaceName() const OVERRIDE; | 85 virtual const AtomicString& interfaceName() const override; |
| 86 virtual ExecutionContext* executionContext() const OVERRIDE; | 86 virtual ExecutionContext* executionContext() const override; |
| 87 | 87 |
| 88 // URLRegistrable | 88 // URLRegistrable |
| 89 virtual URLRegistry& registry() const OVERRIDE; | 89 virtual URLRegistry& registry() const override; |
| 90 | 90 |
| 91 virtual void trace(Visitor*) OVERRIDE; | 91 virtual void trace(Visitor*) override; |
| 92 | 92 |
| 93 private: | 93 private: |
| 94 MediaStream(ExecutionContext*, MediaStreamDescriptor*); | 94 MediaStream(ExecutionContext*, MediaStreamDescriptor*); |
| 95 MediaStream(ExecutionContext*, const MediaStreamTrackVector& audioTracks, co
nst MediaStreamTrackVector& videoTracks); | 95 MediaStream(ExecutionContext*, const MediaStreamTrackVector& audioTracks, co
nst MediaStreamTrackVector& videoTracks); |
| 96 | 96 |
| 97 // ContextLifecycleObserver | 97 // ContextLifecycleObserver |
| 98 virtual void contextDestroyed() OVERRIDE; | 98 virtual void contextDestroyed() override; |
| 99 | 99 |
| 100 // MediaStreamDescriptorClient | 100 // MediaStreamDescriptorClient |
| 101 virtual void addRemoteTrack(MediaStreamComponent*) OVERRIDE; | 101 virtual void addRemoteTrack(MediaStreamComponent*) override; |
| 102 virtual void removeRemoteTrack(MediaStreamComponent*) OVERRIDE; | 102 virtual void removeRemoteTrack(MediaStreamComponent*) override; |
| 103 | 103 |
| 104 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); | 104 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); |
| 105 void scheduledEventTimerFired(Timer<MediaStream>*); | 105 void scheduledEventTimerFired(Timer<MediaStream>*); |
| 106 | 106 |
| 107 bool m_stopped; | 107 bool m_stopped; |
| 108 | 108 |
| 109 MediaStreamTrackVector m_audioTracks; | 109 MediaStreamTrackVector m_audioTracks; |
| 110 MediaStreamTrackVector m_videoTracks; | 110 MediaStreamTrackVector m_videoTracks; |
| 111 Member<MediaStreamDescriptor> m_descriptor; | 111 Member<MediaStreamDescriptor> m_descriptor; |
| 112 | 112 |
| 113 Timer<MediaStream> m_scheduledEventTimer; | 113 Timer<MediaStream> m_scheduledEventTimer; |
| 114 WillBeHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; | 114 WillBeHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 typedef HeapVector<Member<MediaStream> > MediaStreamVector; | 117 typedef HeapVector<Member<MediaStream> > MediaStreamVector; |
| 118 | 118 |
| 119 } // namespace blink | 119 } // namespace blink |
| 120 | 120 |
| 121 #endif // MediaStream_h | 121 #endif // MediaStream_h |
| OLD | NEW |