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

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

Issue 1528843004: Only force preload=none over cellular for http, https, ftp URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@media
Patch Set: Update. Created 4 years, 9 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 | « no previous file | 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 9cf088ea4a43868bb36da0181b2db08f23d4ea81..b06999fc8fef9ecf7be5adac38493fe5c88b2d5a 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -1008,6 +1008,9 @@ void HTMLMediaElement::loadResource(const KURL& url, ContentType& contentType)
if (effectivePreloadType() == WebMediaPlayer::PreloadNone) {
WTF_LOG(Media, "HTMLMediaElement::loadResource(%p) : Delaying load because preload == 'none'", this);
deferLoad();
+ } else if (networkStateNotifier().isCellularConnectionType() && (m_currentSrc.protocolIsInHTTPFamily() || m_currentSrc.protocolIs("ftp"))) {
philipj_slow 2016/03/21 11:59:37 OK, so since we last discussed this, srirama@ has
+ WTF_LOG(Media, "HTMLMediaElement::loadResource(%p) : Delaying load because because of cellular network.", this);
+ deferLoad();
} else {
startPlayerLoad();
}
@@ -1923,12 +1926,6 @@ void HTMLMediaElement::setPreload(const AtomicString& preload)
WebMediaPlayer::Preload HTMLMediaElement::preloadType() const
{
- // Force preload to none for cellular connections.
- if (networkStateNotifier().isCellularConnectionType()) {
- UseCounter::count(document(), UseCounter::HTMLMediaElementPreloadForcedNone);
- return WebMediaPlayer::PreloadNone;
- }
-
const AtomicString& preload = fastGetAttribute(preloadAttr);
if (equalIgnoringCase(preload, "none")) {
UseCounter::count(document(), UseCounter::HTMLMediaElementPreloadNone);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698