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

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

Issue 2049513002: To M51: MSE, MS, and any blob URL: Ignore preload 'none' on resource fetching Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 6 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/LayoutTests/http/tests/media/media-source/mediasource-preload.html ('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 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 setPlayerPreload(); 1020 setPlayerPreload();
1021 1021
1022 if (fastHasAttribute(mutedAttr)) 1022 if (fastHasAttribute(mutedAttr))
1023 m_muted = true; 1023 m_muted = true;
1024 updateVolume(); 1024 updateVolume();
1025 1025
1026 ASSERT(!m_mediaSource); 1026 ASSERT(!m_mediaSource);
1027 1027
1028 bool attemptLoad = true; 1028 bool attemptLoad = true;
1029 1029
1030 if (url.protocolIs(mediaSourceBlobProtocol)) { 1030 bool isStreamOrBlobUrl = url.protocolIs(mediaSourceBlobProtocol);
1031 if (isStreamOrBlobUrl) {
1031 if (isMediaStreamURL(url.getString())) { 1032 if (isMediaStreamURL(url.getString())) {
1032 m_autoplayHelper->removeUserGestureRequirement(GesturelessPlaybackEn abledByStream); 1033 m_autoplayHelper->removeUserGestureRequirement(GesturelessPlaybackEn abledByStream);
1033 } else { 1034 } else {
1034 m_mediaSource = HTMLMediaSource::lookup(url.getString()); 1035 m_mediaSource = HTMLMediaSource::lookup(url.getString());
1035 1036
1036 if (m_mediaSource) { 1037 if (m_mediaSource) {
1037 if (!m_mediaSource->attachToElement(this)) { 1038 if (!m_mediaSource->attachToElement(this)) {
1038 // Forget our reference to the MediaSource, so we leave it a lone 1039 // Forget our reference to the MediaSource, so we leave it a lone
1039 // while processing remainder of load failure. 1040 // while processing remainder of load failure.
1040 m_mediaSource = nullptr; 1041 m_mediaSource = nullptr;
1041 attemptLoad = false; 1042 attemptLoad = false;
1042 } 1043 }
1043 } 1044 }
1044 } 1045 }
1045 } 1046 }
1046 1047
1047 if (attemptLoad && canLoadURL(url, contentType)) { 1048 if (attemptLoad && canLoadURL(url, contentType)) {
1048 ASSERT(!webMediaPlayer()); 1049 ASSERT(!webMediaPlayer());
1049 1050
1050 if (effectivePreloadType() == WebMediaPlayer::PreloadNone) { 1051 // Conditionally defer the load if effective preload is 'none'.
1052 // Skip this optional deferral for any blob URL, including MediaStream
1053 // and MediaSource blob URLs.
1054 if (!isStreamOrBlobUrl && effectivePreloadType() == WebMediaPlayer::Prel oadNone) {
1051 WTF_LOG(Media, "HTMLMediaElement::loadResource(%p) : Delaying load b ecause preload == 'none'", this); 1055 WTF_LOG(Media, "HTMLMediaElement::loadResource(%p) : Delaying load b ecause preload == 'none'", this);
1052 deferLoad(); 1056 deferLoad();
1053 } else { 1057 } else {
1054 startPlayerLoad(); 1058 startPlayerLoad();
1055 } 1059 }
1056 } else { 1060 } else {
1057 mediaLoadingFailed(WebMediaPlayer::NetworkStateFormatError); 1061 mediaLoadingFailed(WebMediaPlayer::NetworkStateFormatError);
1058 } 1062 }
1059 1063
1060 // If there is no poster to display, allow the media engine to render video frames as soon as 1064 // If there is no poster to display, allow the media engine to render video frames as soon as
(...skipping 2823 matching lines...) Expand 10 before | Expand all | Expand 10 after
3884 } 3888 }
3885 3889
3886 #if !ENABLE(OILPAN) 3890 #if !ENABLE(OILPAN)
3887 WeakPtr<HTMLMediaElement> HTMLMediaElement::createWeakPtr() 3891 WeakPtr<HTMLMediaElement> HTMLMediaElement::createWeakPtr()
3888 { 3892 {
3889 return m_weakPtrFactory.createWeakPtr(); 3893 return m_weakPtrFactory.createWeakPtr();
3890 } 3894 }
3891 #endif 3895 #endif
3892 3896
3893 } // namespace blink 3897 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-preload.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698