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

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

Issue 1418133011: Remove the named item getters on TextTrackList and TextTrackCueList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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) 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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 mediaControls()->reset(); 816 mediaControls()->reset();
817 } 817 }
818 818
819 void HTMLMediaElement::loadInternal() 819 void HTMLMediaElement::loadInternal()
820 { 820 {
821 // HTMLMediaElement::textTracksAreReady will need "... the text tracks whose mode was not in the 821 // HTMLMediaElement::textTracksAreReady will need "... the text tracks whose mode was not in the
822 // disabled state when the element's resource selection algorithm last start ed". 822 // disabled state when the element's resource selection algorithm last start ed".
823 m_textTracksWhenResourceSelectionBegan.clear(); 823 m_textTracksWhenResourceSelectionBegan.clear();
824 if (m_textTracks) { 824 if (m_textTracks) {
825 for (unsigned i = 0; i < m_textTracks->length(); ++i) { 825 for (unsigned i = 0; i < m_textTracks->length(); ++i) {
826 TextTrack* track = m_textTracks->item(i); 826 TextTrack* track = m_textTracks->anonymousIndexedGetter(i);
827 if (track->mode() != TextTrack::disabledKeyword()) 827 if (track->mode() != TextTrack::disabledKeyword())
828 m_textTracksWhenResourceSelectionBegan.append(track); 828 m_textTracksWhenResourceSelectionBegan.append(track);
829 } 829 }
830 } 830 }
831 831
832 selectMediaResource(); 832 selectMediaResource();
833 } 833 }
834 834
835 void HTMLMediaElement::selectMediaResource() 835 void HTMLMediaElement::selectMediaResource()
836 { 836 {
(...skipping 2322 matching lines...) Expand 10 before | Expand all | Expand 10 after
3159 3159
3160 WebLayer* HTMLMediaElement::platformLayer() const 3160 WebLayer* HTMLMediaElement::platformLayer() const
3161 { 3161 {
3162 return m_webLayer; 3162 return m_webLayer;
3163 } 3163 }
3164 3164
3165 bool HTMLMediaElement::hasClosedCaptions() const 3165 bool HTMLMediaElement::hasClosedCaptions() const
3166 { 3166 {
3167 if (m_textTracks) { 3167 if (m_textTracks) {
3168 for (unsigned i = 0; i < m_textTracks->length(); ++i) { 3168 for (unsigned i = 0; i < m_textTracks->length(); ++i) {
3169 if (m_textTracks->item(i)->readinessState() == TextTrack::FailedToLo ad) 3169 TextTrack* track = m_textTracks->anonymousIndexedGetter(i);
3170 if (track->readinessState() == TextTrack::FailedToLoad)
3170 continue; 3171 continue;
3171 3172
3172 if (m_textTracks->item(i)->kind() == TextTrack::captionsKeyword() 3173 if (track->kind() == TextTrack::captionsKeyword()
3173 || m_textTracks->item(i)->kind() == TextTrack::subtitlesKeyword( )) 3174 || track->kind() == TextTrack::subtitlesKeyword())
3174 return true; 3175 return true;
3175 } 3176 }
3176 } 3177 }
3177 return false; 3178 return false;
3178 } 3179 }
3179 3180
3180 bool HTMLMediaElement::closedCaptionsVisible() const 3181 bool HTMLMediaElement::closedCaptionsVisible() const
3181 { 3182 {
3182 return m_closedCaptionsVisible; 3183 return m_closedCaptionsVisible;
3183 } 3184 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
3288 if (!m_textTracks) 3289 if (!m_textTracks)
3289 return; 3290 return;
3290 3291
3291 // Mark all tracks as not "configured" so that 3292 // Mark all tracks as not "configured" so that
3292 // honorUserPreferencesForAutomaticTextTrackSelection() will reconsider 3293 // honorUserPreferencesForAutomaticTextTrackSelection() will reconsider
3293 // which tracks to display in light of new user preferences (e.g. default 3294 // which tracks to display in light of new user preferences (e.g. default
3294 // tracks should not be displayed if the user has turned off captions and 3295 // tracks should not be displayed if the user has turned off captions and
3295 // non-default tracks should be displayed based on language preferences if 3296 // non-default tracks should be displayed based on language preferences if
3296 // the user has turned captions on). 3297 // the user has turned captions on).
3297 for (unsigned i = 0; i < m_textTracks->length(); ++i) { 3298 for (unsigned i = 0; i < m_textTracks->length(); ++i) {
3298 TextTrack* textTrack = m_textTracks->item(i); 3299 TextTrack* textTrack = m_textTracks->anonymousIndexedGetter(i);
3299 String kind = textTrack->kind(); 3300 String kind = textTrack->kind();
3300 3301
3301 if (kind == TextTrack::subtitlesKeyword() || kind == TextTrack::captions Keyword()) 3302 if (kind == TextTrack::subtitlesKeyword() || kind == TextTrack::captions Keyword())
3302 textTrack->setHasBeenConfigured(false); 3303 textTrack->setHasBeenConfigured(false);
3303 } 3304 }
3304 } 3305 }
3305 3306
3306 unsigned HTMLMediaElement::webkitAudioDecodedByteCount() const 3307 unsigned HTMLMediaElement::webkitAudioDecodedByteCount() const
3307 { 3308 {
3308 if (!webMediaPlayer()) 3309 if (!webMediaPlayer())
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
3645 visitor->trace(m_client); 3646 visitor->trace(m_client);
3646 } 3647 }
3647 3648
3648 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) 3649 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl)
3649 { 3650 {
3650 visitor->trace(m_client); 3651 visitor->trace(m_client);
3651 } 3652 }
3652 #endif 3653 #endif
3653 3654
3654 } 3655 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698