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

Side by Side 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 unified diff | 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 »
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 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after
1901 } 1901 }
1902 1902
1903 void HTMLMediaElement::setPreload(const AtomicString& preload) 1903 void HTMLMediaElement::setPreload(const AtomicString& preload)
1904 { 1904 {
1905 WTF_LOG(Media, "HTMLMediaElement::setPreload(%p, %s)", this, preload.utf8(). data()); 1905 WTF_LOG(Media, "HTMLMediaElement::setPreload(%p, %s)", this, preload.utf8(). data());
1906 setAttribute(preloadAttr, preload); 1906 setAttribute(preloadAttr, preload);
1907 } 1907 }
1908 1908
1909 WebMediaPlayer::Preload HTMLMediaElement::preloadType() const 1909 WebMediaPlayer::Preload HTMLMediaElement::preloadType() const
1910 { 1910 {
1911 // Force preload to none for cellular connections. 1911 // 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
1912 if (networkStateNotifier().connectionType() == WebConnectionTypeCellular) { 1912 const bool isNetworkURL = m_currentSrc.protocolIsInHTTPFamily() || m_current Src.protocolIs("ftp");
1913 if (isNetworkURL && networkStateNotifier().connectionType() == WebConnection TypeCellular) {
1913 UseCounter::count(document(), UseCounter::HTMLMediaElementPreloadForcedN one); 1914 UseCounter::count(document(), UseCounter::HTMLMediaElementPreloadForcedN one);
1914 return WebMediaPlayer::PreloadNone; 1915 return WebMediaPlayer::PreloadNone;
1915 } 1916 }
1916 1917
1917 const AtomicString& preload = fastGetAttribute(preloadAttr); 1918 const AtomicString& preload = fastGetAttribute(preloadAttr);
1918 if (equalIgnoringCase(preload, "none")) { 1919 if (equalIgnoringCase(preload, "none")) {
1919 UseCounter::count(document(), UseCounter::HTMLMediaElementPreloadNone); 1920 UseCounter::count(document(), UseCounter::HTMLMediaElementPreloadNone);
1920 return WebMediaPlayer::PreloadNone; 1921 return WebMediaPlayer::PreloadNone;
1921 } 1922 }
1922 if (equalIgnoringCase(preload, "metadata")) { 1923 if (equalIgnoringCase(preload, "metadata")) {
(...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after
3652 visitor->trace(m_client); 3653 visitor->trace(m_client);
3653 } 3654 }
3654 3655
3655 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) 3656 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl)
3656 { 3657 {
3657 visitor->trace(m_client); 3658 visitor->trace(m_client);
3658 } 3659 }
3659 #endif 3660 #endif
3660 3661
3661 } 3662 }
OLDNEW
« 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