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

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: Created 5 years 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/media/video-preload-override-cellular.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 77aa5fe35409933471eb164bbb4b5be025ecc02e..f132a0780837869915ccc75b990ef7f1cce2d928 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -1908,8 +1908,9 @@ void HTMLMediaElement::setPreload(const AtomicString& preload)
WebMediaPlayer::Preload HTMLMediaElement::preloadType() const
{
- // Force preload to none for cellular connections.
- if (networkStateNotifier().connectionType() == WebConnectionTypeCellular) {
+ // Force preload to none for cellular connections for online resources.
philipj_slow 2015/12/16 14:39:05 I think the idea is right, but that modifying prel
Srirama 2015/12/16 14:54:12 Should we consider content:// (content providers i
philipj_slow 2015/12/16 15:25:31 Does that currently work with media elements? http
DaleCurtis 2015/12/17 00:02:19 There are a few different injectables AFAIK, WebVi
+ const bool isNetworkURL = m_currentSrc.protocolIsInHTTPFamily() || m_currentSrc.protocolIs("ftp");
+ if (isNetworkURL && networkStateNotifier().connectionType() == WebConnectionTypeCellular) {
UseCounter::count(document(), UseCounter::HTMLMediaElementPreloadForcedNone);
return WebMediaPlayer::PreloadNone;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/media/video-preload-override-cellular.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698