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

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

Issue 2191533003: Refactor Timer classes in preparation for landing FrameTimers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More build fixes Created 4 years, 4 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
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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 } 388 }
389 389
390 void MediaStream::scheduleDispatchEvent(Event* event) 390 void MediaStream::scheduleDispatchEvent(Event* event)
391 { 391 {
392 m_scheduledEvents.append(event); 392 m_scheduledEvents.append(event);
393 393
394 if (!m_scheduledEventTimer.isActive()) 394 if (!m_scheduledEventTimer.isActive())
395 m_scheduledEventTimer.startOneShot(0, BLINK_FROM_HERE); 395 m_scheduledEventTimer.startOneShot(0, BLINK_FROM_HERE);
396 } 396 }
397 397
398 void MediaStream::scheduledEventTimerFired(Timer<MediaStream>*) 398 void MediaStream::scheduledEventTimerFired(TimerBase*)
399 { 399 {
400 if (m_stopped) 400 if (m_stopped)
401 return; 401 return;
402 402
403 HeapVector<Member<Event>> events; 403 HeapVector<Member<Event>> events;
404 events.swap(m_scheduledEvents); 404 events.swap(m_scheduledEvents);
405 405
406 HeapVector<Member<Event>>::iterator it = events.begin(); 406 HeapVector<Member<Event>>::iterator it = events.begin();
407 for (; it != events.end(); ++it) 407 for (; it != events.end(); ++it)
408 dispatchEvent((*it).release()); 408 dispatchEvent((*it).release());
(...skipping 16 matching lines...) Expand all
425 ContextLifecycleObserver::trace(visitor); 425 ContextLifecycleObserver::trace(visitor);
426 MediaStreamDescriptorClient::trace(visitor); 426 MediaStreamDescriptorClient::trace(visitor);
427 } 427 }
428 428
429 MediaStream* toMediaStream(MediaStreamDescriptor* descriptor) 429 MediaStream* toMediaStream(MediaStreamDescriptor* descriptor)
430 { 430 {
431 return static_cast<MediaStream*>(descriptor->client()); 431 return static_cast<MediaStream*>(descriptor->client());
432 } 432 }
433 433
434 } // namespace blink 434 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698