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

Side by Side Diff: Source/modules/mediastream/MediaStream.cpp

Issue 189833009: Trace where timers were scheduled in Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 9 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 | Annotate | Revision Log
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, 2012 Ericsson AB. All rights reserved. 3 * Copyright (C) 2011, 2012 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 RefPtr<MediaStreamTrack> track = (*tracks)[index]; 321 RefPtr<MediaStreamTrack> track = (*tracks)[index];
322 tracks->remove(index); 322 tracks->remove(index);
323 scheduleDispatchEvent(MediaStreamTrackEvent::create(EventTypeNames::removetr ack, false, false, track)); 323 scheduleDispatchEvent(MediaStreamTrackEvent::create(EventTypeNames::removetr ack, false, false, track));
324 } 324 }
325 325
326 void MediaStream::scheduleDispatchEvent(PassRefPtr<Event> event) 326 void MediaStream::scheduleDispatchEvent(PassRefPtr<Event> event)
327 { 327 {
328 m_scheduledEvents.append(event); 328 m_scheduledEvents.append(event);
329 329
330 if (!m_scheduledEventTimer.isActive()) 330 if (!m_scheduledEventTimer.isActive())
331 m_scheduledEventTimer.startOneShot(0); 331 m_scheduledEventTimer.startOneShot(0, FROM_HERE);
332 } 332 }
333 333
334 void MediaStream::scheduledEventTimerFired(Timer<MediaStream>*) 334 void MediaStream::scheduledEventTimerFired(Timer<MediaStream>*)
335 { 335 {
336 if (m_stopped) 336 if (m_stopped)
337 return; 337 return;
338 338
339 Vector<RefPtr<Event> > events; 339 Vector<RefPtr<Event> > events;
340 events.swap(m_scheduledEvents); 340 events.swap(m_scheduledEvents);
341 341
342 Vector<RefPtr<Event> >::iterator it = events.begin(); 342 Vector<RefPtr<Event> >::iterator it = events.begin();
343 for (; it != events.end(); ++it) 343 for (; it != events.end(); ++it)
344 dispatchEvent((*it).release()); 344 dispatchEvent((*it).release());
345 345
346 events.clear(); 346 events.clear();
347 } 347 }
348 348
349 URLRegistry& MediaStream::registry() const 349 URLRegistry& MediaStream::registry() const
350 { 350 {
351 return MediaStreamRegistry::registry(); 351 return MediaStreamRegistry::registry();
352 } 352 }
353 353
354 } // namespace WebCore 354 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698