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

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

Issue 1233313008: Stop calling configureTextTrackDisplay() in clearMediaPlayer() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: proper test Created 5 years, 5 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 | « Source/core/html/HTMLMediaElement.h ('k') | 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 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 mediaControls()->refreshClosedCaptionsButtonVisibility(); 1138 mediaControls()->refreshClosedCaptionsButtonVisibility();
1139 } 1139 }
1140 } 1140 }
1141 1141
1142 void HTMLMediaElement::textTrackModeChanged(TextTrack* track) 1142 void HTMLMediaElement::textTrackModeChanged(TextTrack* track)
1143 { 1143 {
1144 // Mark this track as "configured" so configureTextTracks won't change the m ode again. 1144 // Mark this track as "configured" so configureTextTracks won't change the m ode again.
1145 if (track->trackType() == TextTrack::TrackElement) 1145 if (track->trackType() == TextTrack::TrackElement)
1146 track->setHasBeenConfigured(true); 1146 track->setHasBeenConfigured(true);
1147 1147
1148 configureTextTrackDisplay(AssumeVisibleChange); 1148 configureTextTrackDisplay();
1149 1149
1150 ASSERT(textTracks()->contains(track)); 1150 ASSERT(textTracks()->contains(track));
1151 textTracks()->scheduleChangeEvent(); 1151 textTracks()->scheduleChangeEvent();
1152 } 1152 }
1153 1153
1154 bool HTMLMediaElement::isSafeToLoadURL(const KURL& url, InvalidURLAction actionI fInvalid) 1154 bool HTMLMediaElement::isSafeToLoadURL(const KURL& url, InvalidURLAction actionI fInvalid)
1155 { 1155 {
1156 if (!url.isValid()) { 1156 if (!url.isValid()) {
1157 WTF_LOG(Media, "HTMLMediaElement::isSafeToLoadURL(%p, %s) -> FALSE becau se url is invalid", this, urlForLoggingMedia(url).utf8().data()); 1157 WTF_LOG(Media, "HTMLMediaElement::isSafeToLoadURL(%p, %s) -> FALSE becau se url is invalid", this, urlForLoggingMedia(url).utf8().data());
1158 return false; 1158 return false;
(...skipping 1906 matching lines...) Expand 10 before | Expand all | Expand 10 after
3065 3065
3066 m_pendingActionFlags &= ~flags; 3066 m_pendingActionFlags &= ~flags;
3067 m_loadState = WaitingForSource; 3067 m_loadState = WaitingForSource;
3068 3068
3069 // We can't cast if we don't have a media player. 3069 // We can't cast if we don't have a media player.
3070 m_remoteRoutesAvailable = false; 3070 m_remoteRoutesAvailable = false;
3071 m_playingRemotely = false; 3071 m_playingRemotely = false;
3072 if (mediaControls()) 3072 if (mediaControls())
3073 mediaControls()->refreshCastButtonVisibility(); 3073 mediaControls()->refreshCastButtonVisibility();
3074 3074
3075 if (m_textTracks)
3076 configureTextTrackDisplay(AssumeNoVisibleChange);
3077
3078 if (layoutObject()) 3075 if (layoutObject())
3079 layoutObject()->setShouldDoFullPaintInvalidation(); 3076 layoutObject()->setShouldDoFullPaintInvalidation();
3080 } 3077 }
3081 3078
3082 void HTMLMediaElement::stop() 3079 void HTMLMediaElement::stop()
3083 { 3080 {
3084 WTF_LOG(Media, "HTMLMediaElement::stop(%p)", this); 3081 WTF_LOG(Media, "HTMLMediaElement::stop(%p)", this);
3085 3082
3086 if (m_playing && m_initialPlayWithoutUserGestures) 3083 if (m_playing && m_initialPlayWithoutUserGestures)
3087 gesturelessInitialPlayHalted(); 3084 gesturelessInitialPlayHalted();
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
3413 mediaControls()->hide(); 3410 mediaControls()->hide();
3414 } 3411 }
3415 3412
3416 CueTimeline& HTMLMediaElement::cueTimeline() 3413 CueTimeline& HTMLMediaElement::cueTimeline()
3417 { 3414 {
3418 if (!m_cueTimeline) 3415 if (!m_cueTimeline)
3419 m_cueTimeline = adoptPtrWillBeNoop(new CueTimeline(*this)); 3416 m_cueTimeline = adoptPtrWillBeNoop(new CueTimeline(*this));
3420 return *m_cueTimeline; 3417 return *m_cueTimeline;
3421 } 3418 }
3422 3419
3423 void HTMLMediaElement::configureTextTrackDisplay(VisibilityChangeAssumption assu mption) 3420 void HTMLMediaElement::configureTextTrackDisplay()
3424 { 3421 {
3425 ASSERT(m_textTracks); 3422 ASSERT(m_textTracks);
3426 WTF_LOG(Media, "HTMLMediaElement::configureTextTrackDisplay(%p)", this); 3423 WTF_LOG(Media, "HTMLMediaElement::configureTextTrackDisplay(%p)", this);
3427 3424
3428 if (m_processingPreferenceChange) 3425 if (m_processingPreferenceChange)
3429 return; 3426 return;
3430 3427
3431 bool haveVisibleTextTrack = m_textTracks->hasShowingTracks(); 3428 m_haveVisibleTextTrack = m_textTracks->hasShowingTracks();
3432
3433 if (assumption == AssumeNoVisibleChange
3434 && m_haveVisibleTextTrack == haveVisibleTextTrack) {
3435 cueTimeline().updateActiveCues(currentTime());
3436 return;
3437 }
3438 m_haveVisibleTextTrack = haveVisibleTextTrack;
3439 m_closedCaptionsVisible = m_haveVisibleTextTrack; 3429 m_closedCaptionsVisible = m_haveVisibleTextTrack;
3440 3430
3441 if (!m_haveVisibleTextTrack && !mediaControls()) 3431 if (!m_haveVisibleTextTrack && !mediaControls())
3442 return; 3432 return;
3443 3433
3444 if (mediaControls()) 3434 if (mediaControls())
3445 mediaControls()->changedClosedCaptionsVisibility(); 3435 mediaControls()->changedClosedCaptionsVisibility();
3446 3436
3447 cueTimeline().updateActiveCues(currentTime()); 3437 cueTimeline().updateActiveCues(currentTime());
3448 3438
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
3705 3695
3706 #if ENABLE(WEB_AUDIO) 3696 #if ENABLE(WEB_AUDIO)
3707 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) 3697 void HTMLMediaElement::clearWeakMembers(Visitor* visitor)
3708 { 3698 {
3709 if (!Heap::isHeapObjectAlive(m_audioSourceNode) && audioSourceProvider()) 3699 if (!Heap::isHeapObjectAlive(m_audioSourceNode) && audioSourceProvider())
3710 audioSourceProvider()->setClient(nullptr); 3700 audioSourceProvider()->setClient(nullptr);
3711 } 3701 }
3712 #endif 3702 #endif
3713 3703
3714 } 3704 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698