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

Side by Side Diff: third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.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) 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 bool MediaKeys::sessionTypeSupported(WebEncryptedMediaSessionType sessionType) 235 bool MediaKeys::sessionTypeSupported(WebEncryptedMediaSessionType sessionType)
236 { 236 {
237 for (size_t i = 0; i < m_supportedSessionTypes.size(); i++) { 237 for (size_t i = 0; i < m_supportedSessionTypes.size(); i++) {
238 if (m_supportedSessionTypes[i] == sessionType) 238 if (m_supportedSessionTypes[i] == sessionType)
239 return true; 239 return true;
240 } 240 }
241 241
242 return false; 242 return false;
243 } 243 }
244 244
245 void MediaKeys::timerFired(Timer<MediaKeys>*) 245 void MediaKeys::timerFired(TimerBase*)
246 { 246 {
247 DCHECK(m_pendingActions.size()); 247 DCHECK(m_pendingActions.size());
248 248
249 // Swap the queue to a local copy to avoid problems if resolving promises 249 // Swap the queue to a local copy to avoid problems if resolving promises
250 // run synchronously. 250 // run synchronously.
251 HeapDeque<Member<PendingAction>> pendingActions; 251 HeapDeque<Member<PendingAction>> pendingActions;
252 pendingActions.swap(m_pendingActions); 252 pendingActions.swap(m_pendingActions);
253 253
254 while (!pendingActions.isEmpty()) { 254 while (!pendingActions.isEmpty()) {
255 PendingAction* action = pendingActions.takeFirst(); 255 PendingAction* action = pendingActions.takeFirst();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 void MediaKeys::stop() 301 void MediaKeys::stop()
302 { 302 {
303 ActiveDOMObject::stop(); 303 ActiveDOMObject::stop();
304 304
305 if (m_timer.isActive()) 305 if (m_timer.isActive())
306 m_timer.stop(); 306 m_timer.stop();
307 m_pendingActions.clear(); 307 m_pendingActions.clear();
308 } 308 }
309 309
310 } // namespace blink 310 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698