Bug 76560 - Need a WebKit2 API for setting media volume
Summary: Need a WebKit2 API for setting media volume
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ada Chan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-18 12:06 PST by Ada Chan
Modified: 2012-01-19 13:34 PST (History)
1 user (show)

See Also:


Attachments
Patch (6.21 KB, patch)
2012-01-18 12:18 PST, Ada Chan
mitz: review-
Details | Formatted Diff | Diff
Take 2: Make sure WebPageProxy caches the media volume value. (9.65 KB, patch)
2012-01-18 15:50 PST, Ada Chan
no flags Details | Formatted Diff | Diff
Take 3 (10.21 KB, patch)
2012-01-18 17:50 PST, Ada Chan
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ada Chan 2012-01-18 12:06:02 PST
Add a WebKit2 API for setting media volume in a page.

Needed for <rdar://problem/10619329>
Comment 1 Ada Chan 2012-01-18 12:18:10 PST
Created attachment 122974 [details]
Patch
Comment 2 mitz 2012-01-18 13:34:45 PST
Comment on attachment 122974 [details]
Patch

Like most settings on WKPage, this setting needs to persist even if  the Web process crashes and gets relaunched. This means that you need to cache it in a member variable in WebPagePorxy, and add it to WebPageCreationParameters and to WebPageProxy::creationParameters() and the WebPage constructor. Having the value cached in the WebPageProxy would also make it easy to add a getter on WKPage in addition to the setter you’ve added.
Comment 3 Ada Chan 2012-01-18 14:45:46 PST
(In reply to comment #2)
> (From update of attachment 122974 [details])
> Like most settings on WKPage, this setting needs to persist even if  the Web process crashes and gets relaunched. This means that you need to cache it in a member variable in WebPagePorxy, and add it to WebPageCreationParameters and to WebPageProxy::creationParameters() and the WebPage constructor. Having the value cached in the WebPageProxy would also make it easy to add a getter on WKPage in addition to the setter you’ve added.

Thanks for the review!  I'll make the changes you suggested.
Comment 4 Ada Chan 2012-01-18 15:50:27 PST
Created attachment 123026 [details]
Take 2: Make sure WebPageProxy caches the media volume value.
Comment 5 Ada Chan 2012-01-18 17:50:15 PST
Created attachment 123044 [details]
Take 3

Two more fixes:
- Need to set the media volume with value from WebPageCreationParameters in WebPage::WebPage().
- Need to set WebPageProxy::m_mediaVolume even if the associated WebPage is no longer valid in the web process, since that updated value should be used when the web process is relaunched.
Comment 6 Ada Chan 2012-01-19 13:34:32 PST
Committed: http://trac.webkit.org/changeset/105439