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

Unified 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 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 32c2ce5f56607a0f61750cc17d6ce97b1ffa72ca..963c7d6b2efac7f249ab4878941435d6a9f1ac88 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -1027,7 +1027,8 @@ void HTMLMediaElement::loadResource(const KURL& url, ContentType& contentType)
bool attemptLoad = true;
- if (url.protocolIs(mediaSourceBlobProtocol)) {
+ bool isStreamOrBlobUrl = url.protocolIs(mediaSourceBlobProtocol);
+ if (isStreamOrBlobUrl) {
if (isMediaStreamURL(url.getString())) {
m_autoplayHelper->removeUserGestureRequirement(GesturelessPlaybackEnabledByStream);
} else {
@@ -1047,7 +1048,10 @@ void HTMLMediaElement::loadResource(const KURL& url, ContentType& contentType)
if (attemptLoad && canLoadURL(url, contentType)) {
ASSERT(!webMediaPlayer());
- if (effectivePreloadType() == WebMediaPlayer::PreloadNone) {
+ // Conditionally defer the load if effective preload is 'none'.
+ // Skip this optional deferral for any blob URL, including MediaStream
+ // and 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