Bug 24965

Summary: HTMLMediaElement: network state changes can be missed
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
proposed patch simon.fraser: review+

Description Eric Carlson 2009-03-31 14:40:54 PDT
A bug in the logic of HTMLMediaElement::setNetworkState can cause a network state change to be missed.
Comment 1 Eric Carlson 2009-03-31 14:51:44 PDT
Created attachment 29132 [details]
proposed patch
Comment 2 Simon Fraser (smfr) 2009-03-31 15:10:34 PDT
Comment on attachment 29132 [details]
proposed patch

> +            MediaPlayer::ReadyState currentState = m_player->readyState();
> +            if (static_cast<ReadyState>(currentState) != m_readyState)

This cast is pretty heinous. It would be nice to:
1. Have MediaPlayer ReadyState have a somewhat different name (PlayerReadyState).
2. Have a method that converts them: ReadyState readyStateForPlayerReadyState(PlayerReadyState) rather than casting.

But those can be done in a later commit.
Comment 3 Eric Carlson 2009-03-31 15:14:11 PDT
Committed revision 42144.