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

Side by Side Diff: third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp

Issue 1671033002: Do not let go of MediaStreamTracks too early. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 for (HeapHashSet<Member<MediaStream>>::iterator iter = m_registeredMediaStre ams.begin(); iter != m_registeredMediaStreams.end(); ++iter) 203 for (HeapHashSet<Member<MediaStream>>::iterator iter = m_registeredMediaStre ams.begin(); iter != m_registeredMediaStreams.end(); ++iter)
204 (*iter)->trackEnded(); 204 (*iter)->trackEnded();
205 m_isIteratingRegisteredMediaStreams = false; 205 m_isIteratingRegisteredMediaStreams = false;
206 } 206 }
207 207
208 void MediaStreamTrack::stop() 208 void MediaStreamTrack::stop()
209 { 209 {
210 m_stopped = true; 210 m_stopped = true;
211 } 211 }
212 212
213 bool MediaStreamTrack::hasPendingActivity() const
214 {
215 return !m_stopped && hasEventListeners();
sof 2016/02/07 06:54:27 I wonder if something effectively like this needs
sof 2016/02/07 07:04:36 I notice MajorGCWrapperVisitor has special handlin
haraken 2016/02/07 07:21:31 Yeah, without having the check, we'll end up with
216 }
217
213 PassOwnPtr<AudioSourceProvider> MediaStreamTrack::createWebAudioSource() 218 PassOwnPtr<AudioSourceProvider> MediaStreamTrack::createWebAudioSource()
214 { 219 {
215 return MediaStreamCenter::instance().createWebAudioSourceFromMediaStreamTrac k(component()); 220 return MediaStreamCenter::instance().createWebAudioSourceFromMediaStreamTrac k(component());
216 } 221 }
217 222
218 void MediaStreamTrack::registerMediaStream(MediaStream* mediaStream) 223 void MediaStreamTrack::registerMediaStream(MediaStream* mediaStream)
219 { 224 {
220 RELEASE_ASSERT(!m_isIteratingRegisteredMediaStreams); 225 RELEASE_ASSERT(!m_isIteratingRegisteredMediaStreams);
221 RELEASE_ASSERT(!m_registeredMediaStreams.contains(mediaStream)); 226 RELEASE_ASSERT(!m_registeredMediaStreams.contains(mediaStream));
222 m_registeredMediaStreams.add(mediaStream); 227 m_registeredMediaStreams.add(mediaStream);
(...skipping 19 matching lines...) Expand all
242 247
243 DEFINE_TRACE(MediaStreamTrack) 248 DEFINE_TRACE(MediaStreamTrack)
244 { 249 {
245 visitor->trace(m_registeredMediaStreams); 250 visitor->trace(m_registeredMediaStreams);
246 visitor->trace(m_component); 251 visitor->trace(m_component);
247 RefCountedGarbageCollectedEventTargetWithInlineData<MediaStreamTrack>::trace (visitor); 252 RefCountedGarbageCollectedEventTargetWithInlineData<MediaStreamTrack>::trace (visitor);
248 ActiveDOMObject::trace(visitor); 253 ActiveDOMObject::trace(visitor);
249 } 254 }
250 255
251 } // namespace blink 256 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698