Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |