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

Side by Side Diff: Source/core/html/HTMLMediaElement.cpp

Issue 189833009: Trace where timers were scheduled in Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 526
527 if ((actionType & LoadMediaResource) && !(m_pendingActionFlags & LoadMediaRe source)) { 527 if ((actionType & LoadMediaResource) && !(m_pendingActionFlags & LoadMediaRe source)) {
528 prepareForLoad(); 528 prepareForLoad();
529 m_pendingActionFlags |= LoadMediaResource; 529 m_pendingActionFlags |= LoadMediaResource;
530 } 530 }
531 531
532 if (RuntimeEnabledFeatures::videoTrackEnabled() && (actionType & LoadTextTra ckResource)) 532 if (RuntimeEnabledFeatures::videoTrackEnabled() && (actionType & LoadTextTra ckResource))
533 m_pendingActionFlags |= LoadTextTrackResource; 533 m_pendingActionFlags |= LoadTextTrackResource;
534 534
535 if (!m_loadTimer.isActive()) 535 if (!m_loadTimer.isActive())
536 m_loadTimer.startOneShot(0); 536 m_loadTimer.startOneShot(0, FROM_HERE);
537 } 537 }
538 538
539 void HTMLMediaElement::scheduleNextSourceChild() 539 void HTMLMediaElement::scheduleNextSourceChild()
540 { 540 {
541 // Schedule the timer to try the next <source> element WITHOUT resetting sta te ala prepareForLoad. 541 // Schedule the timer to try the next <source> element WITHOUT resetting sta te ala prepareForLoad.
542 m_pendingActionFlags |= LoadMediaResource; 542 m_pendingActionFlags |= LoadMediaResource;
543 m_loadTimer.startOneShot(0); 543 m_loadTimer.startOneShot(0, FROM_HERE);
544 } 544 }
545 545
546 void HTMLMediaElement::scheduleEvent(const AtomicString& eventName) 546 void HTMLMediaElement::scheduleEvent(const AtomicString& eventName)
547 { 547 {
548 #if LOG_MEDIA_EVENTS 548 #if LOG_MEDIA_EVENTS
549 WTF_LOG(Media, "HTMLMediaElement::scheduleEvent - scheduling '%s'", eventNam e.ascii().data()); 549 WTF_LOG(Media, "HTMLMediaElement::scheduleEvent - scheduling '%s'", eventNam e.ascii().data());
550 #endif 550 #endif
551 m_asyncEventQueue->enqueueEvent(Event::createCancelable(eventName)); 551 m_asyncEventQueue->enqueueEvent(Event::createCancelable(eventName));
552 } 552 }
553 553
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
1341 return true; 1341 return true;
1342 } 1342 }
1343 1343
1344 void HTMLMediaElement::startProgressEventTimer() 1344 void HTMLMediaElement::startProgressEventTimer()
1345 { 1345 {
1346 if (m_progressEventTimer.isActive()) 1346 if (m_progressEventTimer.isActive())
1347 return; 1347 return;
1348 1348
1349 m_previousProgressTime = WTF::currentTime(); 1349 m_previousProgressTime = WTF::currentTime();
1350 // 350ms is not magic, it is in the spec! 1350 // 350ms is not magic, it is in the spec!
1351 m_progressEventTimer.startRepeating(0.350); 1351 m_progressEventTimer.startRepeating(0.350, FROM_HERE);
1352 } 1352 }
1353 1353
1354 void HTMLMediaElement::waitForSourceChange() 1354 void HTMLMediaElement::waitForSourceChange()
1355 { 1355 {
1356 WTF_LOG(Media, "HTMLMediaElement::waitForSourceChange"); 1356 WTF_LOG(Media, "HTMLMediaElement::waitForSourceChange");
1357 1357
1358 stopPeriodicTimers(); 1358 stopPeriodicTimers();
1359 m_loadState = WaitingForSource; 1359 m_loadState = WaitingForSource;
1360 1360
1361 // 6.17 - Waiting: Set the element's networkState attribute to the NETWORK_N O_SOURCE value 1361 // 6.17 - Waiting: Set the element's networkState attribute to the NETWORK_N O_SOURCE value
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
2424 // The spec says to fire periodic timeupdate events (those sent while playing) e very 2424 // The spec says to fire periodic timeupdate events (those sent while playing) e very
2425 // "15 to 250ms", we choose the slowest frequency 2425 // "15 to 250ms", we choose the slowest frequency
2426 static const double maxTimeupdateEventFrequency = 0.25; 2426 static const double maxTimeupdateEventFrequency = 0.25;
2427 2427
2428 void HTMLMediaElement::startPlaybackProgressTimer() 2428 void HTMLMediaElement::startPlaybackProgressTimer()
2429 { 2429 {
2430 if (m_playbackProgressTimer.isActive()) 2430 if (m_playbackProgressTimer.isActive())
2431 return; 2431 return;
2432 2432
2433 m_previousProgressTime = WTF::currentTime(); 2433 m_previousProgressTime = WTF::currentTime();
2434 m_playbackProgressTimer.startRepeating(maxTimeupdateEventFrequency); 2434 m_playbackProgressTimer.startRepeating(maxTimeupdateEventFrequency, FROM_HER E);
2435 } 2435 }
2436 2436
2437 void HTMLMediaElement::playbackProgressTimerFired(Timer<HTMLMediaElement>*) 2437 void HTMLMediaElement::playbackProgressTimerFired(Timer<HTMLMediaElement>*)
2438 { 2438 {
2439 ASSERT(m_player); 2439 ASSERT(m_player);
2440 2440
2441 if (m_fragmentEndTime != MediaPlayer::invalidTime() && currentTime() >= m_fr agmentEndTime && m_playbackRate > 0) { 2441 if (m_fragmentEndTime != MediaPlayer::invalidTime() && currentTime() >= m_fr agmentEndTime && m_playbackRate > 0) {
2442 m_fragmentEndTime = MediaPlayer::invalidTime(); 2442 m_fragmentEndTime = MediaPlayer::invalidTime();
2443 if (!m_mediaController && !m_paused) { 2443 if (!m_mediaController && !m_paused) {
2444 UseCounter::count(document(), UseCounter::HTMLMediaElementPauseAtFra gmentEnd); 2444 UseCounter::count(document(), UseCounter::HTMLMediaElementPauseAtFra gmentEnd);
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after
3929 { 3929 {
3930 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); 3930 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource));
3931 } 3931 }
3932 3932
3933 bool HTMLMediaElement::isInteractiveContent() const 3933 bool HTMLMediaElement::isInteractiveContent() const
3934 { 3934 {
3935 return fastHasAttribute(controlsAttr); 3935 return fastHasAttribute(controlsAttr);
3936 } 3936 }
3937 3937
3938 } 3938 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698