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

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

Issue 213343002: Remove traces of beforeload in HTMLMediaElement (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
« no previous file with comments | « no previous file | 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) 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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 void HTMLMediaElement::scheduleEvent(PassRefPtr<Event> event) 519 void HTMLMediaElement::scheduleEvent(PassRefPtr<Event> event)
520 { 520 {
521 #if LOG_MEDIA_EVENTS 521 #if LOG_MEDIA_EVENTS
522 WTF_LOG(Media, "HTMLMediaElement::scheduleEvent - scheduling '%s'", event->t ype().ascii().data()); 522 WTF_LOG(Media, "HTMLMediaElement::scheduleEvent - scheduling '%s'", event->t ype().ascii().data());
523 #endif 523 #endif
524 m_asyncEventQueue->enqueueEvent(event); 524 m_asyncEventQueue->enqueueEvent(event);
525 } 525 }
526 526
527 void HTMLMediaElement::loadTimerFired(Timer<HTMLMediaElement>*) 527 void HTMLMediaElement::loadTimerFired(Timer<HTMLMediaElement>*)
528 { 528 {
529 RefPtr<HTMLMediaElement> protect(this); // loadNextSourceChild may fire 'bef oreload', which can make arbitrary DOM mutations.
530
531 if (RuntimeEnabledFeatures::videoTrackEnabled() && (m_pendingActionFlags & L oadTextTrackResource)) 529 if (RuntimeEnabledFeatures::videoTrackEnabled() && (m_pendingActionFlags & L oadTextTrackResource))
532 configureTextTracks(); 530 configureTextTracks();
533 531
534 if (m_pendingActionFlags & LoadMediaResource) { 532 if (m_pendingActionFlags & LoadMediaResource) {
535 if (m_loadState == LoadingFromSourceElement) 533 if (m_loadState == LoadingFromSourceElement)
536 loadNextSourceChild(); 534 loadNextSourceChild();
537 else 535 else
538 loadInternal(); 536 loadInternal();
539 } 537 }
540 538
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 break; 576 break;
579 } 577 }
580 578
581 WTF_LOG(Media, "HTMLMediaElement::canPlayType(%s, %s) -> %s", mimeType.utf8( ).data(), keySystem.utf8().data(), canPlay.utf8().data()); 579 WTF_LOG(Media, "HTMLMediaElement::canPlayType(%s, %s) -> %s", mimeType.utf8( ).data(), keySystem.utf8().data(), canPlay.utf8().data());
582 580
583 return canPlay; 581 return canPlay;
584 } 582 }
585 583
586 void HTMLMediaElement::load() 584 void HTMLMediaElement::load()
587 { 585 {
588 RefPtr<HTMLMediaElement> protect(this); // loadInternal may result in a 'bef oreload' event, which can make arbitrary DOM mutations.
589
590 WTF_LOG(Media, "HTMLMediaElement::load()"); 586 WTF_LOG(Media, "HTMLMediaElement::load()");
591 587
592 if (UserGestureIndicator::processingUserGesture()) 588 if (UserGestureIndicator::processingUserGesture())
593 m_userGestureRequiredForPlay = false; 589 m_userGestureRequiredForPlay = false;
594 590
595 prepareForLoad(); 591 prepareForLoad();
596 loadInternal(); 592 loadInternal();
597 prepareToPlay(); 593 prepareToPlay();
598 } 594 }
599 595
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 // The spec doesn't say to block the load event until we actually run the as ynchronous section 694 // The spec doesn't say to block the load event until we actually run the as ynchronous section
699 // algorithm, but do it now because we won't start that until after the time r fires and the 695 // algorithm, but do it now because we won't start that until after the time r fires and the
700 // event may have already fired by then. 696 // event may have already fired by then.
701 setShouldDelayLoadEvent(true); 697 setShouldDelayLoadEvent(true);
702 698
703 configureMediaControls(); 699 configureMediaControls();
704 } 700 }
705 701
706 void HTMLMediaElement::loadInternal() 702 void HTMLMediaElement::loadInternal()
707 { 703 {
708 // FIXME: Now that we don't have beforeload events we should make this ASSER T the opposite.
709 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
710
711 // HTMLMediaElement::textTracksAreReady will need "... the text tracks whose mode was not in the 704 // HTMLMediaElement::textTracksAreReady will need "... the text tracks whose mode was not in the
712 // disabled state when the element's resource selection algorithm last start ed". 705 // disabled state when the element's resource selection algorithm last start ed".
713 if (RuntimeEnabledFeatures::videoTrackEnabled()) { 706 if (RuntimeEnabledFeatures::videoTrackEnabled()) {
714 m_textTracksWhenResourceSelectionBegan.clear(); 707 m_textTracksWhenResourceSelectionBegan.clear();
715 if (m_textTracks) { 708 if (m_textTracks) {
716 for (unsigned i = 0; i < m_textTracks->length(); ++i) { 709 for (unsigned i = 0; i < m_textTracks->length(); ++i) {
717 TextTrack* track = m_textTracks->item(i); 710 TextTrack* track = m_textTracks->item(i);
718 if (track->mode() != TextTrack::disabledKeyword()) 711 if (track->mode() != TextTrack::disabledKeyword())
719 m_textTracksWhenResourceSelectionBegan.append(track); 712 m_textTracksWhenResourceSelectionBegan.append(track);
720 } 713 }
(...skipping 2926 matching lines...) Expand 10 before | Expand all | Expand 10 after
3647 { 3640 {
3648 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); 3641 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource));
3649 } 3642 }
3650 3643
3651 bool HTMLMediaElement::isInteractiveContent() const 3644 bool HTMLMediaElement::isInteractiveContent() const
3652 { 3645 {
3653 return fastHasAttribute(controlsAttr); 3646 return fastHasAttribute(controlsAttr);
3654 } 3647 }
3655 3648
3656 } 3649 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698