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

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

Issue 1224083013: Gracefully handle track-less elements on updating track selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « LayoutTests/media/track/track-language-preference-no-crash-expected.txt ('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 3269 matching lines...) Expand 10 before | Expand all | Expand 10 after
3280 void HTMLMediaElement::automaticTrackSelectionForUpdatedUserPreference() 3280 void HTMLMediaElement::automaticTrackSelectionForUpdatedUserPreference()
3281 { 3281 {
3282 markCaptionAndSubtitleTracksAsUnconfigured(); 3282 markCaptionAndSubtitleTracksAsUnconfigured();
3283 m_processingPreferenceChange = true; 3283 m_processingPreferenceChange = true;
3284 m_closedCaptionsVisible = false; 3284 m_closedCaptionsVisible = false;
3285 honorUserPreferencesForAutomaticTextTrackSelection(); 3285 honorUserPreferencesForAutomaticTextTrackSelection();
3286 m_processingPreferenceChange = false; 3286 m_processingPreferenceChange = false;
3287 3287
3288 // If a track is set to 'showing' post performing automatic track selection, 3288 // If a track is set to 'showing' post performing automatic track selection,
3289 // set closed captions state to visible to update the CC button and display the track. 3289 // set closed captions state to visible to update the CC button and display the track.
3290 m_closedCaptionsVisible = m_textTracks->hasShowingTracks(); 3290 if (m_textTracks)
3291 m_closedCaptionsVisible = m_textTracks->hasShowingTracks();
3291 updateTextTrackDisplay(); 3292 updateTextTrackDisplay();
3292 } 3293 }
3293 3294
3294 void HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured() 3295 void HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured()
3295 { 3296 {
3296 if (!m_textTracks) 3297 if (!m_textTracks)
3297 return; 3298 return;
3298 3299
3299 // Mark all tracks as not "configured" so that 3300 // Mark all tracks as not "configured" so that
3300 // honorUserPreferencesForAutomaticTextTrackSelection() will reconsider 3301 // honorUserPreferencesForAutomaticTextTrackSelection() will reconsider
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
3687 3688
3688 #if ENABLE(WEB_AUDIO) 3689 #if ENABLE(WEB_AUDIO)
3689 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) 3690 void HTMLMediaElement::clearWeakMembers(Visitor* visitor)
3690 { 3691 {
3691 if (!Heap::isHeapObjectAlive(m_audioSourceNode) && audioSourceProvider()) 3692 if (!Heap::isHeapObjectAlive(m_audioSourceNode) && audioSourceProvider())
3692 audioSourceProvider()->setClient(nullptr); 3693 audioSourceProvider()->setClient(nullptr);
3693 } 3694 }
3694 #endif 3695 #endif
3695 3696
3696 } 3697 }
OLDNEW
« no previous file with comments | « LayoutTests/media/track/track-language-preference-no-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698