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

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

Issue 1687793002: Use effectivePreloadType() where possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rm m_completelyLoaded Created 4 years, 10 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 | « third_party/WebKit/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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 , m_playing(false) 316 , m_playing(false)
317 , m_shouldDelayLoadEvent(false) 317 , m_shouldDelayLoadEvent(false)
318 , m_haveFiredLoadedData(false) 318 , m_haveFiredLoadedData(false)
319 , m_autoplaying(true) 319 , m_autoplaying(true)
320 , m_muted(false) 320 , m_muted(false)
321 , m_paused(true) 321 , m_paused(true)
322 , m_seeking(false) 322 , m_seeking(false)
323 , m_sentStalledEvent(false) 323 , m_sentStalledEvent(false)
324 , m_sentEndEvent(false) 324 , m_sentEndEvent(false)
325 , m_closedCaptionsVisible(false) 325 , m_closedCaptionsVisible(false)
326 , m_completelyLoaded(false)
327 , m_havePreparedToPlay(false) 326 , m_havePreparedToPlay(false)
328 , m_tracksAreReady(true) 327 , m_tracksAreReady(true)
329 , m_haveVisibleTextTrack(false) 328 , m_haveVisibleTextTrack(false)
330 , m_processingPreferenceChange(false) 329 , m_processingPreferenceChange(false)
331 , m_remoteRoutesAvailable(false) 330 , m_remoteRoutesAvailable(false)
332 , m_playingRemotely(false) 331 , m_playingRemotely(false)
333 , m_isFinalizing(false) 332 , m_isFinalizing(false)
334 , m_initialPlayWithoutUserGesture(false) 333 , m_initialPlayWithoutUserGesture(false)
335 , m_autoplayMediaCounted(false) 334 , m_autoplayMediaCounted(false)
336 , m_inOverlayFullscreenVideo(false) 335 , m_inOverlayFullscreenVideo(false)
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 708
710 // Perform the cleanup required for the resource load algorithm to run. 709 // Perform the cleanup required for the resource load algorithm to run.
711 stopPeriodicTimers(); 710 stopPeriodicTimers();
712 m_loadTimer.stop(); 711 m_loadTimer.stop();
713 cancelDeferredLoad(); 712 cancelDeferredLoad();
714 // FIXME: Figure out appropriate place to reset LoadTextTrackResource if nec essary and set m_pendingActionFlags to 0 here. 713 // FIXME: Figure out appropriate place to reset LoadTextTrackResource if nec essary and set m_pendingActionFlags to 0 here.
715 m_pendingActionFlags &= ~LoadMediaResource; 714 m_pendingActionFlags &= ~LoadMediaResource;
716 m_sentEndEvent = false; 715 m_sentEndEvent = false;
717 m_sentStalledEvent = false; 716 m_sentStalledEvent = false;
718 m_haveFiredLoadedData = false; 717 m_haveFiredLoadedData = false;
719 m_completelyLoaded = false;
720 m_havePreparedToPlay = false; 718 m_havePreparedToPlay = false;
721 m_displayMode = Unknown; 719 m_displayMode = Unknown;
722 720
723 // 1 - Abort any already-running instance of the resource selection algorith m for this element. 721 // 1 - Abort any already-running instance of the resource selection algorith m for this element.
724 m_loadState = WaitingForSource; 722 m_loadState = WaitingForSource;
725 m_currentSourceNode = nullptr; 723 m_currentSourceNode = nullptr;
726 724
727 // 2 - If there are any tasks from the media element's media element event t ask source in 725 // 2 - If there are any tasks from the media element's media element event t ask source in
728 // one of the task queues, then remove those tasks. 726 // one of the task queues, then remove those tasks.
729 cancelPendingEventsAndCallbacks(); 727 cancelPendingEventsAndCallbacks();
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 m_mediaSource = nullptr; 955 m_mediaSource = nullptr;
958 attemptLoad = false; 956 attemptLoad = false;
959 } 957 }
960 } 958 }
961 } 959 }
962 } 960 }
963 961
964 if (attemptLoad && canLoadURL(url, contentType, keySystem)) { 962 if (attemptLoad && canLoadURL(url, contentType, keySystem)) {
965 ASSERT(!webMediaPlayer()); 963 ASSERT(!webMediaPlayer());
966 964
967 if (!m_havePreparedToPlay && !autoplay() && preloadType() == WebMediaPla yer::PreloadNone) { 965 if (!m_havePreparedToPlay && effectivePreloadType() == WebMediaPlayer::P reloadNone) {
968 WTF_LOG(Media, "HTMLMediaElement::loadResource(%p) : Delaying load b ecause preload == 'none'", this); 966 WTF_LOG(Media, "HTMLMediaElement::loadResource(%p) : Delaying load b ecause preload == 'none'", this);
969 deferLoad(); 967 deferLoad();
970 } else { 968 } else {
971 startPlayerLoad(); 969 startPlayerLoad();
972 } 970 }
973 } else { 971 } else {
974 mediaLoadingFailed(WebMediaPlayer::NetworkStateFormatError); 972 mediaLoadingFailed(WebMediaPlayer::NetworkStateFormatError);
975 } 973 }
976 974
977 // If there is no poster to display, allow the media engine to render video frames as soon as 975 // If there is no poster to display, allow the media engine to render video frames as soon as
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1381 setShouldDelayLoadEvent(false); 1379 setShouldDelayLoadEvent(false);
1382 } else { 1380 } else {
1383 setNetworkState(NETWORK_IDLE); 1381 setNetworkState(NETWORK_IDLE);
1384 } 1382 }
1385 } 1383 }
1386 1384
1387 if (state == WebMediaPlayer::NetworkStateLoading) { 1385 if (state == WebMediaPlayer::NetworkStateLoading) {
1388 if (m_networkState < NETWORK_LOADING || m_networkState == NETWORK_NO_SOU RCE) 1386 if (m_networkState < NETWORK_LOADING || m_networkState == NETWORK_NO_SOU RCE)
1389 startProgressEventTimer(); 1387 startProgressEventTimer();
1390 setNetworkState(NETWORK_LOADING); 1388 setNetworkState(NETWORK_LOADING);
1391 m_completelyLoaded = false;
1392 } 1389 }
1393 1390
1394 if (state == WebMediaPlayer::NetworkStateLoaded) { 1391 if (state == WebMediaPlayer::NetworkStateLoaded) {
1395 if (m_networkState != NETWORK_IDLE) 1392 if (m_networkState != NETWORK_IDLE)
1396 changeNetworkStateFromLoadingToIdle(); 1393 changeNetworkStateFromLoadingToIdle();
1397 m_completelyLoaded = true;
1398 } 1394 }
1399 } 1395 }
1400 1396
1401 void HTMLMediaElement::changeNetworkStateFromLoadingToIdle() 1397 void HTMLMediaElement::changeNetworkStateFromLoadingToIdle()
1402 { 1398 {
1403 m_progressEventTimer.stop(); 1399 m_progressEventTimer.stop();
1404 1400
1405 // Schedule one last progress event so we guarantee that at least one is fir ed 1401 // Schedule one last progress event so we guarantee that at least one is fir ed
1406 // for files that load very quickly. 1402 // for files that load very quickly.
1407 if (webMediaPlayer() && webMediaPlayer()->didLoadingProgress()) 1403 if (webMediaPlayer() && webMediaPlayer()->didLoadingProgress())
(...skipping 2218 matching lines...) Expand 10 before | Expand all | Expand 10 after
3626 { 3622 {
3627 visitor->trace(m_client); 3623 visitor->trace(m_client);
3628 } 3624 }
3629 3625
3630 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) 3626 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl)
3631 { 3627 {
3632 visitor->trace(m_client); 3628 visitor->trace(m_client);
3633 } 3629 }
3634 3630
3635 } // namespace blink 3631 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698