Changeset 167868 in webkit
- Timestamp:
- Apr 27, 2014 7:37:42 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r167862 r167868 1 2014-04-27 Praveen R Jadhav <praveen.j@samsung.com> 2 3 [MediaStream] .ended shouldn't be part of MediaStream IDL 4 https://bugs.webkit.org/show_bug.cgi?id=132104 5 6 Reviewed by Eric Carlson. 7 8 .ended is not part of MediaStream IDL. Updated test case. 9 10 * fast/mediastream/MediaStream-add-remove-tracks-expected.txt: 11 * fast/mediastream/MediaStream-add-remove-tracks.html: 12 1 13 2014-04-27 Tim Horton <timothy_horton@apple.com> 2 14 -
trunk/LayoutTests/fast/mediastream/MediaStream-add-remove-tracks-expected.txt
r167750 r167868 48 48 PASS stream2.getAudioTracks().length is 0 49 49 PASS stream2.getVideoTracks().length is 0 50 PASS stream2.ended is true51 50 52 51 *** it should be impossible to add a track after the stream has ended -
trunk/LayoutTests/fast/mediastream/MediaStream-add-remove-tracks.html
r167750 r167868 130 130 shouldBe('stream2.getAudioTracks().length', '0'); 131 131 shouldBe('stream2.getVideoTracks().length', '0'); 132 shouldBeTrue('stream2.ended');133 132 134 133 debug("<br>*** it should be impossible to add a track after the stream has ended"); -
trunk/Source/WebCore/ChangeLog
r167863 r167868 1 2014-04-27 Praveen R Jadhav <praveen.j@samsung.com> 2 3 [MediaStream] .ended shouldn't be part of MediaStream IDL 4 https://bugs.webkit.org/show_bug.cgi?id=132104 5 6 Reviewed by Eric Carlson. 7 8 .ended attribute is spec'ed out of MediaStream IDL. Instead, .active 9 is introduced to handle more scenarios. This patch replaces all 'ended' 10 attribute calls with corresponding 'active' attributes. 11 12 MediaStream-add-remove-tracks.html is updated. 13 14 * Modules/mediastream/MediaStream.cpp: 15 (WebCore::MediaStream::addTrack): Replaced ended() with active(). 16 (WebCore::MediaStream::removeTrack): setEnded() isn't called. setActive() 17 is retained which propagates oninactive event. 18 (WebCore::MediaStream::trackDidEnd): setEnded() isn't called. 19 (WebCore::MediaStream::removeRemoteSource): Replaced ended() with active(). 20 (WebCore::MediaStream::addRemoteTrack): Replaced ended() with active(). 21 (WebCore::MediaStream::removeRemoteTrack): Replaced ended() with active(). 22 (WebCore::MediaStream::ended): Deleted. 23 (WebCore::MediaStream::setEnded): Deleted. 24 (WebCore::MediaStream::streamDidEnd): Deleted. 25 * Modules/mediastream/MediaStream.h: 26 * Modules/mediastream/MediaStream.idl: 27 * Modules/mediastream/RTCPeerConnection.cpp: 28 (WebCore::RTCPeerConnection::didRemoveRemoteStream): Replaced setEnded() 29 with setActive(). 30 * platform/mediastream/MediaStreamPrivate.cpp: 31 (WebCore::MediaStreamPrivate::MediaStreamPrivate): 32 (WebCore::MediaStreamPrivate::setActive): Updated comment from bug 33 https://bugs.webkit.org/show_bug.cgi?id=131973 34 (WebCore::MediaStreamPrivate::setEnded): Deleted. 35 * platform/mediastream/MediaStreamPrivate.h: 36 (WebCore::MediaStreamPrivate::ended): Deleted. 37 1 38 2014-04-25 Andy Estes <aestes@apple.com> 2 39 -
trunk/Source/WebCore/Modules/mediastream/MediaStream.cpp
r167750 r167868 115 115 } 116 116 117 bool MediaStream::ended() const118 {119 return m_private->ended();120 }121 122 void MediaStream::setEnded()123 {124 if (ended())125 return;126 m_private->setEnded();127 }128 129 117 bool MediaStream::active() const 130 118 { … … 156 144 void MediaStream::addTrack(PassRefPtr<MediaStreamTrack> prpTrack, ExceptionCode& ec) 157 145 { 158 if ( ended()) {146 if (!active()) { 159 147 ec = INVALID_STATE_ERR; 160 148 return; … … 191 179 void MediaStream::removeTrack(PassRefPtr<MediaStreamTrack> prpTrack, ExceptionCode& ec) 192 180 { 193 if ( ended()) {181 if (!active()) { 194 182 ec = INVALID_STATE_ERR; 195 183 return; … … 228 216 229 217 track->removeObserver(this); 230 if (!m_audioTracks.size() && !m_videoTracks.size()) { 231 setEnded(); // FIXME : to be removed in bug https://bugs.webkit.org/show_bug.cgi?id=132104 218 if (!m_audioTracks.size() && !m_videoTracks.size()) 232 219 setActive(false); 233 }234 220 235 221 return true; … … 280 266 } 281 267 282 setEnded(); // FIXME : to be removed in bug https://bugs.webkit.org/show_bug.cgi?id=132104283 284 268 if (!m_audioTracks.size() && !m_videoTracks.size()) 285 269 setActive(false); 286 }287 288 void MediaStream::streamDidEnd()289 {290 if (ended())291 return;292 293 scheduleDispatchEvent(Event::create(eventNames().endedEvent, false, false));294 270 } 295 271 … … 316 292 { 317 293 ASSERT(source); 318 if ( ended())294 if (!active()) 319 295 return; 320 296 … … 338 314 { 339 315 ASSERT(privateTrack); 340 if ( ended())316 if (!active()) 341 317 return; 342 318 … … 364 340 { 365 341 ASSERT(privateTrack); 366 if ( ended())342 if (!active()) 367 343 return; 368 344 -
trunk/Source/WebCore/Modules/mediastream/MediaStream.h
r167750 r167868 68 68 Vector<RefPtr<MediaStreamTrack>> getVideoTracks() const { return m_videoTracks; } 69 69 70 bool ended() const;71 void setEnded();72 70 PassRefPtr<MediaStream> clone(); 73 71 74 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended);75 72 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); 76 73 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack); … … 110 107 // MediaStreamPrivateClient 111 108 virtual void trackDidEnd() override final; 112 virtual void streamDidEnd() override final;113 109 virtual void setStreamIsActive(bool) override final; 114 110 virtual void addRemoteSource(MediaStreamSource*) override final; -
trunk/Source/WebCore/Modules/mediastream/MediaStream.idl
r167750 r167868 43 43 MediaStream clone(); 44 44 45 readonly attribute boolean ended;46 47 attribute EventListener onended;48 attribute EventListener onaddtrack;49 attribute EventListener onremovetrack;50 51 45 readonly attribute boolean active; 52 46 53 47 attribute EventListener onactive; 54 48 attribute EventListener oninactive; 49 attribute EventListener onaddtrack; 50 attribute EventListener onremovetrack; 55 51 56 52 // EventTarget interface -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
r166325 r167868 652 652 // FIXME: this class shouldn't know that the private stream client is a MediaStream! 653 653 RefPtr<MediaStream> stream = static_cast<MediaStream*>(privateStream->client()); 654 stream->set Ended();654 stream->setActive(false); 655 655 656 656 if (m_signalingState == SignalingStateClosed) -
trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp
r167750 r167868 129 129 : m_client(0) 130 130 , m_id(id) 131 , m_ended(false)132 131 , m_isActive(false) 133 132 { … … 141 140 unsigned providedSourcesSize = audioSources.size() + videoSources.size(); 142 141 unsigned tracksSize = m_audioPrivateTracks.size() + m_videoPrivateTracks.size(); 143 // If sources were provided and no track was added to the MediaStreamPrivate's tracks, this means144 // that the tracks were all ended.145 // Deprecated. to be removed in bug https://bugs.webkit.org/show_bug.cgi?id=132104146 if (providedSourcesSize > 0 && !tracksSize)147 m_ended = true;148 142 149 143 if (providedSourcesSize > 0 && tracksSize > 0) … … 154 148 : m_client(0) 155 149 , m_id(id) 156 , m_ended(false)157 150 , m_isActive(false) 158 151 { … … 166 159 unsigned providedTracksSize = audioPrivateTracks.size() + videoPrivateTracks.size(); 167 160 unsigned tracksSize = m_audioPrivateTracks.size() + m_videoPrivateTracks.size(); 168 // If tracks were provided and no one was added to the MediaStreamPrivate's tracks, this means169 // that the tracks were all ended170 // Deprecated. to be removed in bug https://bugs.webkit.org/show_bug.cgi?id=132104171 if (providedTracksSize > 0 && !tracksSize)172 m_ended = true;173 161 174 162 if (providedTracksSize > 0 && tracksSize > 0) … … 176 164 } 177 165 178 void MediaStreamPrivate::setEnded()179 {180 if (m_client)181 m_client->streamDidEnd();182 183 m_ended = true;184 }185 186 166 void MediaStreamPrivate::setActive(bool active) 187 167 { 188 if (m_isActive != active) { 189 m_isActive = active; 190 191 if (m_client) 192 m_client->setStreamIsActive(active); 193 } 168 if (m_isActive == active) 169 return; 170 171 m_isActive = active; 172 173 if (m_client) 174 m_client->setStreamIsActive(active); 194 175 } 195 176 -
trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.h
r167750 r167868 50 50 virtual ~MediaStreamPrivateClient() { } 51 51 52 virtual void streamDidEnd() = 0;53 52 virtual void setStreamIsActive(bool) = 0; 54 53 virtual void addRemoteSource(MediaStreamSource*) = 0; … … 88 87 void removeRemoteSource(MediaStreamSource*); 89 88 90 // Deprecated. to be removed in bug https://bugs.webkit.org/show_bug.cgi?id=13210491 bool ended() const { return m_ended; }92 void setEnded();93 94 89 bool active() const { return m_isActive; } 95 90 void setActive(bool); … … 112 107 Vector<RefPtr<MediaStreamTrackPrivate>> m_audioPrivateTracks; 113 108 Vector<RefPtr<MediaStreamTrackPrivate>> m_videoPrivateTracks; 114 bool m_ended; // Deprecated. to be removed in bug https://bugs.webkit.org/show_bug.cgi?id=132104115 109 bool m_isActive; 116 110 };
Note: See TracChangeset
for help on using the changeset viewer.