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

Issue 1276143002: Defer media loading while on cellular networks. (Closed)

Created:
5 years, 4 months ago by DaleCurtis
Modified:
5 years, 2 months ago
Reviewers:
watk, philipj_slow
CC:
blink-reviews, nessy, mlamouri+watch-blink_chromium.org, gasubic, fs, eric.carlson_apple.com, feature-media-reviews_chromium.org, dglazkov+blink, blink-reviews-html_chromium.org, vcarbune.chromium
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Defer media loading while on cellular networks. We only populate networkStateNotifier()'s connectionType() field on a couple platforms, see http://crbug.com/368358 for details, but it does work on Android at least. This prevents us from wasting bandwidth on videos when the device is on a cellular connection. BUG=516766 TEST=Load deferred when forced to true, TBD: actual device test.

Patch Set 1 #

Patch Set 2 : Rework. Add tests. Fix singleton state. #

Total comments: 2

Patch Set 3 : Cleanup. #

Total comments: 3

Messages

Total messages: 18 (3 generated)
DaleCurtis
I don't think this is likely the right way to do this, but sending out ...
5 years, 4 months ago (2015-08-07 02:55:04 UTC) #2
philipj_slow
On 2015/08/07 02:55:04, DaleCurtis wrote: > I don't think this is likely the right way ...
5 years, 4 months ago (2015-08-10 10:09:56 UTC) #3
DaleCurtis
Ooh, effectivePreloadType() seems like a reasonable place. Yes, the least-hacky way to think about this ...
5 years, 4 months ago (2015-08-10 16:15:03 UTC) #4
philipj_slow
On 2015/08/10 16:15:03, DaleCurtis wrote: > Ooh, effectivePreloadType() seems like a reasonable place. Yes, the ...
5 years, 4 months ago (2015-08-11 09:51:36 UTC) #5
DaleCurtis
On 2015/08/11 09:51:36, philipj wrote: > On 2015/08/10 16:15:03, DaleCurtis wrote: > > Ooh, effectivePreloadType() ...
5 years, 4 months ago (2015-08-12 01:35:38 UTC) #6
philipj_slow
On 2015/08/12 01:35:38, DaleCurtis wrote: > On 2015/08/11 09:51:36, philipj wrote: > > On 2015/08/10 ...
5 years, 4 months ago (2015-08-12 07:35:39 UTC) #7
DaleCurtis
On 2015/08/12 07:35:39, philipj wrote: > On 2015/08/12 01:35:38, DaleCurtis wrote: > > > > ...
5 years, 4 months ago (2015-08-18 18:54:48 UTC) #8
philipj_slow
OK, so in summary I think a reasonable change would be to make the fallback ...
5 years, 4 months ago (2015-08-19 10:24:36 UTC) #9
DaleCurtis
Okay finally got back to this, updated mostly as discussed, but it ended up possible ...
5 years, 2 months ago (2015-09-30 00:52:54 UTC) #12
watk
lgtm https://codereview.chromium.org/1276143002/diff/60001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/1276143002/diff/60001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode1969 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:1969: preloadType = forcePreloadNone ? WebMediaPlayer::PreloadNone : WebMediaPlayer::PreloadAuto; It ...
5 years, 2 months ago (2015-09-30 01:21:53 UTC) #13
DaleCurtis
https://codereview.chromium.org/1276143002/diff/60001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/1276143002/diff/60001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode1969 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:1969: preloadType = forcePreloadNone ? WebMediaPlayer::PreloadNone : WebMediaPlayer::PreloadAuto; On 2015/09/30 ...
5 years, 2 months ago (2015-09-30 01:33:45 UTC) #14
philipj_slow
Unless you can change the base URL (https://chromium.googlesource.com/chromium/blink.git@master) I think you'll have to create a ...
5 years, 2 months ago (2015-09-30 11:18:07 UTC) #15
philipj_slow
https://codereview.chromium.org/1276143002/diff/80001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/1276143002/diff/80001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode1968 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:1968: preloadType = WebMediaPlayer::PreloadNone; Making this an early return to ...
5 years, 2 months ago (2015-09-30 11:19:30 UTC) #16
DaleCurtis
Ack, rebased the git commit, but forgot to use a new CL, done here: https://codereview.chromium.org/1381613003/ ...
5 years, 2 months ago (2015-09-30 16:18:19 UTC) #17
philipj_slow
5 years, 2 months ago (2015-10-01 09:49:07 UTC) #18
Message was sent while issue was closed.
https://codereview.chromium.org/1276143002/diff/80001/third_party/WebKit/Sour...
File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right):

https://codereview.chromium.org/1276143002/diff/80001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:1968: preloadType =
WebMediaPlayer::PreloadNone;
On 2015/09/30 16:18:19, DaleCurtis_OOO_Until_Oct_16 wrote:
> On 2015/09/30 11:19:30, philipj wrote:
> > Making this an early return to avoid even looking the attribute would be
nice.
> 
> I didn't do that so that we could keep the use counters for the attribute.

Hmm, good point, but if they're counted without being used it might be
misleading. I suggest instead adding a
UseCounter::HTMLMediaElementPreloadNoneDueToConnectionType or similar.

Powered by Google App Engine
This is Rietveld 408576698