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

Issue 2616803002: Clear m_readyStateMaximum when there is no source.

Created:
3 years, 11 months ago by sandersd (OOO until July 31)
Modified:
3 years, 7 months ago
CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, eric.carlson_apple.com, feature-media-reviews_chromium.org, fs, gasubic, mlamouri+watch-blink_chromium.org, nessy, Srirama, vcarbune.chromium
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Clear m_readyStateMaximum when there is no source. BUG=674716

Patch Set 1 #

Patch Set 2 : Remove duplicate assignment. #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -0 lines) Patch
M third_party/WebKit/Source/core/html/HTMLMediaElement.cpp View 1 1 chunk +3 lines, -0 lines 11 comments Download

Messages

Total messages: 21 (3 generated)
sandersd (OOO until July 31)
Is there any other state we should be clearing as well? load() would otherwise also: ...
3 years, 11 months ago (2017-01-05 01:26:06 UTC) #2
sandersd (OOO until July 31)
Oh, or we could set the network state to kNetworkNoSource. I don't know if that ...
3 years, 11 months ago (2017-01-05 18:56:07 UTC) #3
sandersd (OOO until July 31)
On 2017/01/05 18:56:07, sandersd wrote: > Oh, or we could set the network state to ...
3 years, 11 months ago (2017-01-23 23:59:02 UTC) #6
foolip
What's the status of this now?
3 years, 11 months ago (2017-01-26 05:00:50 UTC) #7
foolip
https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode955 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:955: m_readyStateMaximum = kHaveNothing; At this point, why has m_readyState ...
3 years, 11 months ago (2017-01-26 05:06:56 UTC) #8
sandersd (OOO until July 31)
https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode955 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:955: m_readyStateMaximum = kHaveNothing; On 2017/01/26 05:06:56, foolip_UTC7 wrote: > ...
3 years, 11 months ago (2017-01-26 19:17:16 UTC) #9
foolip
https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode955 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:955: m_readyStateMaximum = kHaveNothing; On 2017/01/26 19:17:16, sandersd wrote: > ...
3 years, 10 months ago (2017-01-27 06:23:07 UTC) #10
sandersd (OOO until July 31)
https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode955 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:955: m_readyStateMaximum = kHaveNothing; > I guess we had a ...
3 years, 10 months ago (2017-01-27 19:19:47 UTC) #11
mlamouri (slow - plz ping)
That's not a trivial issue :) It would be great sandersd@ if you could write ...
3 years, 10 months ago (2017-02-10 14:51:52 UTC) #12
foolip
https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode955 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:955: m_readyStateMaximum = kHaveNothing; On 2017/01/27 19:19:47, sandersd wrote: > ...
3 years, 10 months ago (2017-02-21 06:59:14 UTC) #13
sandersd (OOO until July 31)
https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode955 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:955: m_readyStateMaximum = kHaveNothing; On 2017/02/21 06:59:14, foolip_UTC9 wrote: > ...
3 years, 8 months ago (2017-04-01 00:17:29 UTC) #14
foolip
https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode955 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:955: m_readyStateMaximum = kHaveNothing; On 2017/04/01 00:17:28, sandersd wrote: > ...
3 years, 8 months ago (2017-04-04 04:09:50 UTC) #15
sandersd (OOO until July 31)
https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode955 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:955: m_readyStateMaximum = kHaveNothing; > After this point, is it ...
3 years, 8 months ago (2017-04-04 19:03:52 UTC) #16
foolip
https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode955 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:955: m_readyStateMaximum = kHaveNothing; On 2017/04/04 19:03:52, sandersd wrote: > ...
3 years, 8 months ago (2017-04-05 04:46:41 UTC) #17
mlamouri (slow - plz ping)
https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode955 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:955: m_readyStateMaximum = kHaveNothing; On 2017/04/05 at 04:46:40, foolip OOO ...
3 years, 8 months ago (2017-04-18 14:00:13 UTC) #18
foolip
https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/2616803002/diff/20001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode955 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:955: m_readyStateMaximum = kHaveNothing; On 2017/04/18 14:00:13, mlamouri wrote: > ...
3 years, 8 months ago (2017-04-21 16:03:49 UTC) #19
sandersd (OOO until July 31)
> > - setNetworkState(WebMediaPlayer::NetworkState) (seems like this > > should never happen) > > If ...
3 years, 7 months ago (2017-04-28 22:04:54 UTC) #20
foolip
3 years, 7 months ago (2017-05-03 15:13:58 UTC) #21
On 2017/04/28 22:04:54, sandersd wrote:
> > >  - setNetworkState(WebMediaPlayer::NetworkState) (seems like this
> > > should never happen)
> >
> > If it should never happen, we should add a DCHECK.
> 
> Agreed, but in practice HTMLMediaElement uses the same setter for internal use
> as well, so there is no obvious place for the DCHECK to go.
> 
> > sandersd@, do you want to try the fix outlined above
> 
> Each time I attempt this, I run into the problem of not being sure exactly
what
> state I should be resetting when.
> 
> Simply destroying the player does nothing; the only normal path that clears
> |ready_state_maximum_| is InvokeLoadAlgorithm() with |network_state_ ==
> kNetworkEmpty|.
> 
> There are several different methods for clearing state:
>   - ClearMediaPlayer(): Doesn't affect ready state.
>   - ClearMediaPlayerAndAudioSourceProviderClientWithoutLocking(): Doesn't
affect
> ready state.
>   - ResetMediaPlayerAndMediaSource(): Doesn't affect ready state.
>   - Dispose(): Doesn't affect ready state.
>   - ContextDestroyed(): Probably actually does what we want, but clearly
wasn't
> meant for this.
> 
> If it's as simple as factoring ContextDestroyed() out so that I can call the
> same implementation, that is easy, but I have little confidence in the
> correctness of my attempts so far.

There are indeed too many reset method. ResetMediaPlayerAndMediaSource() even
has a TODO to merge it into something that doesn't exist anymore. Refactoring
the three first methods in your list to make more sense at a glance would be
nice. I suspect that ClearMediaPlayer() and ResetMediaPlayerAndMediaSource()
could be merged, they already share some bits. Or at least all of the clearing
methods should form some kind of hierarchy where it's clear at which level to
call in which context.

Lacking such a cleanup, adding stuff to both ClearMediaPlayer() and
ResetMediaPlayerAndMediaSource() might just have the intended effect, but it's
hard to be confident without trying it.

Powered by Google App Engine
This is Rietveld 408576698