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

Unified Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 1881733004: MSE, MS, and any blob URL: Ignore preload 'none' on resource fetching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix more '->" in the new test. [2] is now pending review at wpt. Created 4 years, 8 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index fbb33611b4b8eb845abfd5eb67750ca412e4cd86..a23c6a4f7feeac806f2ce01e6a46fe57afe6bc7a 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -996,7 +996,8 @@ void HTMLMediaElement::loadResource(const WebMediaPlayerSource& source, ContentT
bool attemptLoad = true;
- if (source.isMediaStream() || url.protocolIs(mediaSourceBlobProtocol)) {
+ bool isStreamOrBlobUrl = source.isMediaStream() || url.protocolIs(mediaSourceBlobProtocol);
+ if (isStreamOrBlobUrl) {
bool isMediaStream = source.isMediaStream() || (source.isURL() && isMediaStreamURL(url.getString()));
if (isMediaStream) {
m_autoplayHelper->removeUserGestureRequirement(GesturelessPlaybackEnabledByStream);
@@ -1018,7 +1019,10 @@ void HTMLMediaElement::loadResource(const WebMediaPlayerSource& source, ContentT
if (attemptLoad && canLoadResource) {
ASSERT(!webMediaPlayer());
- if (effectivePreloadType() == WebMediaPlayer::PreloadNone) {
+ // Conditionally defer the load if effective preload is 'none'.
+ // Skip this optional deferral for MediaStream sources or any blob URL,
+ // including MediaSource blob URLs.
+ if (!isStreamOrBlobUrl && effectivePreloadType() == WebMediaPlayer::PreloadNone) {
WTF_LOG(Media, "HTMLMediaElement::loadResource(%p) : Delaying load because preload == 'none'", this);
deferLoad();
} else {
« 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