Bug 23923 - HTMLMediaElement should implement mediaPlayerVolumeChanged
Summary: HTMLMediaElement should implement mediaPlayerVolumeChanged
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-12 08:44 PST by Eric Carlson
Modified: 2009-02-12 15:14 PST (History)
0 users

See Also:


Attachments
proposed patch (6.53 KB, patch)
2009-02-12 09:00 PST, Eric Carlson
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2009-02-12 08:44:38 PST
The MediaPlayerClient interface has a mediaPlayerVolumeChanged method so a media engine can report volume changes triggered by the media engine. HTMLMediaElement implements all MediaPlayerClient methods except this.
Comment 1 Eric Carlson 2009-02-12 09:00:35 PST
Created attachment 27604 [details]
proposed patch
Comment 2 Simon Fraser (smfr) 2009-02-12 14:16:03 PST
Comment on attachment 27604 [details]
proposed patch

> Index: WebCore/html/HTMLMediaElement.cpp
> ===================================================================

> +    // avoid recursion when the player reports volume changes

Sentence case.

> Index: WebCore/html/HTMLMediaElement.h
> ===================================================================

> +    bool processingMediaPlayerCallback() { return m_processingMediaPlayerCallback > 0; };

Make this |const|

> +    void setProcessingMediaPlayerCallback(bool processing) { m_processingMediaPlayerCallback += (processing ? 1 : -1); }

To avoid the somewhat hard to read 'true', 'false' args, maybe have 2 methods (begin/end).
Add an assertion to check that m_processingMediaPlayerCallback never goes negative, and make it signed.
Comment 3 Eric Carlson 2009-02-12 15:14:35 PST
Committed revision 40943.