| OLD | NEW |
| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 , m_haveFiredLoadedData(false) | 342 , m_haveFiredLoadedData(false) |
| 343 , m_autoplaying(true) | 343 , m_autoplaying(true) |
| 344 , m_muted(false) | 344 , m_muted(false) |
| 345 , m_paused(true) | 345 , m_paused(true) |
| 346 , m_seeking(false) | 346 , m_seeking(false) |
| 347 , m_sentStalledEvent(false) | 347 , m_sentStalledEvent(false) |
| 348 , m_sentEndEvent(false) | 348 , m_sentEndEvent(false) |
| 349 , m_closedCaptionsVisible(false) | 349 , m_closedCaptionsVisible(false) |
| 350 , m_completelyLoaded(false) | 350 , m_completelyLoaded(false) |
| 351 , m_havePreparedToPlay(false) | 351 , m_havePreparedToPlay(false) |
| 352 , m_didPerformAutomaticTrackSelection(false) |
| 352 , m_tracksAreReady(true) | 353 , m_tracksAreReady(true) |
| 353 , m_haveVisibleTextTrack(false) | 354 , m_haveVisibleTextTrack(false) |
| 354 , m_processingPreferenceChange(false) | 355 , m_processingPreferenceChange(false) |
| 355 , m_remoteRoutesAvailable(false) | 356 , m_remoteRoutesAvailable(false) |
| 356 , m_playingRemotely(false) | 357 , m_playingRemotely(false) |
| 357 #if ENABLE(OILPAN) | 358 #if ENABLE(OILPAN) |
| 358 , m_isFinalizing(false) | 359 , m_isFinalizing(false) |
| 359 , m_closeMediaSourceWhenFinalizing(false) | 360 , m_closeMediaSourceWhenFinalizing(false) |
| 360 #endif | 361 #endif |
| 361 , m_initialPlayWithoutUserGestures(false) | 362 , m_initialPlayWithoutUserGestures(false) |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1160 // Mark this track as "configured" so configureTextTracks won't change the m
ode again. | 1161 // Mark this track as "configured" so configureTextTracks won't change the m
ode again. |
| 1161 if (track->trackType() == TextTrack::TrackElement) | 1162 if (track->trackType() == TextTrack::TrackElement) |
| 1162 track->setHasBeenConfigured(true); | 1163 track->setHasBeenConfigured(true); |
| 1163 | 1164 |
| 1164 configureTextTrackDisplay(AssumeVisibleChange); | 1165 configureTextTrackDisplay(AssumeVisibleChange); |
| 1165 | 1166 |
| 1166 ASSERT(textTracks()->contains(track)); | 1167 ASSERT(textTracks()->contains(track)); |
| 1167 textTracks()->scheduleChangeEvent(); | 1168 textTracks()->scheduleChangeEvent(); |
| 1168 } | 1169 } |
| 1169 | 1170 |
| 1171 void HTMLMediaElement::disableAutomaticTextTrackSelection() |
| 1172 { |
| 1173 m_didPerformAutomaticTrackSelection = true; |
| 1174 } |
| 1175 |
| 1170 bool HTMLMediaElement::isSafeToLoadURL(const KURL& url, InvalidURLAction actionI
fInvalid) | 1176 bool HTMLMediaElement::isSafeToLoadURL(const KURL& url, InvalidURLAction actionI
fInvalid) |
| 1171 { | 1177 { |
| 1172 if (!url.isValid()) { | 1178 if (!url.isValid()) { |
| 1173 WTF_LOG(Media, "HTMLMediaElement::isSafeToLoadURL(%p, %s) -> FALSE becau
se url is invalid", this, urlForLoggingMedia(url).utf8().data()); | 1179 WTF_LOG(Media, "HTMLMediaElement::isSafeToLoadURL(%p, %s) -> FALSE becau
se url is invalid", this, urlForLoggingMedia(url).utf8().data()); |
| 1174 return false; | 1180 return false; |
| 1175 } | 1181 } |
| 1176 | 1182 |
| 1177 LocalFrame* frame = document().frame(); | 1183 LocalFrame* frame = document().frame(); |
| 1178 if (!frame || !document().securityOrigin()->canDisplay(url)) { | 1184 if (!frame || !document().securityOrigin()->canDisplay(url)) { |
| 1179 if (actionIfInvalid == Complain) | 1185 if (actionIfInvalid == Complain) |
| (...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2474 size_t index = m_textTracksWhenResourceSelectionBegan.find(textTrack.get()); | 2480 size_t index = m_textTracksWhenResourceSelectionBegan.find(textTrack.get()); |
| 2475 if (index != kNotFound) | 2481 if (index != kNotFound) |
| 2476 m_textTracksWhenResourceSelectionBegan.remove(index); | 2482 m_textTracksWhenResourceSelectionBegan.remove(index); |
| 2477 } | 2483 } |
| 2478 | 2484 |
| 2479 void HTMLMediaElement::honorUserPreferencesForAutomaticTextTrackSelection() | 2485 void HTMLMediaElement::honorUserPreferencesForAutomaticTextTrackSelection() |
| 2480 { | 2486 { |
| 2481 if (!m_textTracks || !m_textTracks->length()) | 2487 if (!m_textTracks || !m_textTracks->length()) |
| 2482 return; | 2488 return; |
| 2483 | 2489 |
| 2490 if (m_didPerformAutomaticTrackSelection) |
| 2491 return; |
| 2492 |
| 2484 AutomaticTrackSelection::Configuration configuration; | 2493 AutomaticTrackSelection::Configuration configuration; |
| 2485 if (m_processingPreferenceChange) | 2494 if (m_processingPreferenceChange) |
| 2486 configuration.disableCurrentlyEnabledTracks = true; | 2495 configuration.disableCurrentlyEnabledTracks = true; |
| 2487 if (m_closedCaptionsVisible) | 2496 if (m_closedCaptionsVisible) |
| 2488 configuration.forceEnableSubtitleOrCaptionTrack = true; | 2497 configuration.forceEnableSubtitleOrCaptionTrack = true; |
| 2489 | 2498 |
| 2490 AutomaticTrackSelection trackSelection(configuration); | 2499 AutomaticTrackSelection trackSelection(configuration); |
| 2491 trackSelection.perform(*m_textTracks); | 2500 trackSelection.perform(*m_textTracks); |
| 2492 | 2501 |
| 2493 textTracksChanged(); | 2502 textTracksChanged(); |
| (...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3673 | 3682 |
| 3674 #if ENABLE(WEB_AUDIO) | 3683 #if ENABLE(WEB_AUDIO) |
| 3675 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) | 3684 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) |
| 3676 { | 3685 { |
| 3677 if (!visitor->isHeapObjectAlive(m_audioSourceNode) && audioSourceProvider()) | 3686 if (!visitor->isHeapObjectAlive(m_audioSourceNode) && audioSourceProvider()) |
| 3678 audioSourceProvider()->setClient(nullptr); | 3687 audioSourceProvider()->setClient(nullptr); |
| 3679 } | 3688 } |
| 3680 #endif | 3689 #endif |
| 3681 | 3690 |
| 3682 } | 3691 } |
| OLD | NEW |