WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
147629
Media Session: add a focus manager that WebKit clients can use to access the focused media element
https://bugs.webkit.org/show_bug.cgi?id=147629
Summary
Media Session: add a focus manager that WebKit clients can use to access the ...
Matt Rajca
Reported
2015-08-04 09:50:08 PDT
In the UI process, we keep track of the "focused" Content media element across all web processes. Clients should be able to access this state to get information about the focused media element such as its metadata or whether its paused. This is useful in UIs such as lock screens and notification areas.
Attachments
Patch
(59.80 KB, patch)
2015-08-04 10:11 PDT
,
Matt Rajca
no flags
Details
Formatted Diff
Diff
Patch
(59.93 KB, patch)
2015-08-04 10:57 PDT
,
Matt Rajca
no flags
Details
Formatted Diff
Diff
Patch
(59.93 KB, patch)
2015-08-04 11:39 PDT
,
Matt Rajca
no flags
Details
Formatted Diff
Diff
Patch
(59.89 KB, patch)
2015-08-04 16:36 PDT
,
Matt Rajca
thorton
: review+
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Matt Rajca
Comment 1
2015-08-04 10:11:19 PDT
Created
attachment 258180
[details]
Patch
WebKit Commit Bot
Comment 2
2015-08-04 10:13:10 PDT
Attachment 258180
[details]
did not pass style-queue: ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:3886: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5] ERROR: Source/WebKit2/UIProcess/WebPageProxy.h:946: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5] Total errors found: 2 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Matt Rajca
Comment 3
2015-08-04 10:57:01 PDT
Created
attachment 258184
[details]
Patch
WebKit Commit Bot
Comment 4
2015-08-04 10:58:42 PDT
Attachment 258184
[details]
did not pass style-queue: ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:3886: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5] ERROR: Source/WebKit2/UIProcess/WebPageProxy.h:946: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5] Total errors found: 2 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Matt Rajca
Comment 5
2015-08-04 11:39:59 PDT
Created
attachment 258191
[details]
Patch
WebKit Commit Bot
Comment 6
2015-08-04 11:43:31 PDT
Attachment 258191
[details]
did not pass style-queue: ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:3886: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5] ERROR: Source/WebKit2/UIProcess/WebPageProxy.h:946: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5] Total errors found: 2 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Tim Horton
Comment 7
2015-08-04 16:29:18 PDT
Comment on
attachment 258191
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=258191&action=review
> Source/WebKit2/UIProcess/WebMediaSessionFocusManager.cpp:67 > + ASSERT(proxy);
No real need for this assert if you're just going to go ahead and dereference the null pointer two lines away.
> Source/WebKit2/UIProcess/WebMediaSessionFocusManager.h:38 > +typedef std::tuple<WebPageProxy*, uint64_t> FocusedMediaElement;
might be clearer if this is a std::pair? then you don't have the fairly surprising std::get in the impl. Unless you're planning to add more components.
> Source/WebKit2/UIProcess/WebMediaSessionFocusManager.h:40 > +class WebMediaSessionFocusManager: public API::ObjectImpl<API::Object::Type::MediaSessionFocusManager>, public WebContextSupplement {
space before the colon
> Source/WebKit2/WebKit2.xcodeproj/project.pbxproj:-7626 > - 15739BBD1B42042D00D258C1 /* WebUserMediaClient.h in Headers */,
This patch is doing a surprising about of xcodeproj reordering.
Matt Rajca
Comment 8
2015-08-04 16:35:08 PDT
(In reply to
comment #7
)
> Comment on
attachment 258191
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=258191&action=review
> > > Source/WebKit2/UIProcess/WebMediaSessionFocusManager.cpp:67 > > + ASSERT(proxy); > > No real need for this assert if you're just going to go ahead and > dereference the null pointer two lines away.
Removed.
> > > Source/WebKit2/UIProcess/WebMediaSessionFocusManager.h:38 > > +typedef std::tuple<WebPageProxy*, uint64_t> FocusedMediaElement; > > might be clearer if this is a std::pair? then you don't have the fairly > surprising std::get in the impl. Unless you're planning to add more > components.
Switched to std::pair. Much cleaner.
> > > Source/WebKit2/UIProcess/WebMediaSessionFocusManager.h:40 > > +class WebMediaSessionFocusManager: public API::ObjectImpl<API::Object::Type::MediaSessionFocusManager>, public WebContextSupplement { > > space before the colon
Added.
> > > Source/WebKit2/WebKit2.xcodeproj/project.pbxproj:-7626 > > - 15739BBD1B42042D00D258C1 /* WebUserMediaClient.h in Headers */, > > This patch is doing a surprising about of xcodeproj reordering.
I just ran sort-xcode-project.
Matt Rajca
Comment 9
2015-08-04 16:36:28 PDT
Created
attachment 258233
[details]
Patch
WebKit Commit Bot
Comment 10
2015-08-04 16:38:37 PDT
Attachment 258233
[details]
did not pass style-queue: ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:3886: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5] ERROR: Source/WebKit2/UIProcess/WebPageProxy.h:946: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5] Total errors found: 2 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Tim Horton
Comment 11
2015-08-04 16:48:43 PDT
(In reply to
comment #8
)
> (In reply to
comment #7
) > > Comment on
attachment 258191
[details]
> > Patch > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=258191&action=review
> > > > > Source/WebKit2/UIProcess/WebMediaSessionFocusManager.cpp:67 > > > + ASSERT(proxy); > > > > No real need for this assert if you're just going to go ahead and > > dereference the null pointer two lines away. > > Removed. > > > > > > Source/WebKit2/UIProcess/WebMediaSessionFocusManager.h:38 > > > +typedef std::tuple<WebPageProxy*, uint64_t> FocusedMediaElement; > > > > might be clearer if this is a std::pair? then you don't have the fairly > > surprising std::get in the impl. Unless you're planning to add more > > components. > > Switched to std::pair. Much cleaner. > > > > > > Source/WebKit2/UIProcess/WebMediaSessionFocusManager.h:40 > > > +class WebMediaSessionFocusManager: public API::ObjectImpl<API::Object::Type::MediaSessionFocusManager>, public WebContextSupplement { > > > > space before the colon > > Added. > > > > > > Source/WebKit2/WebKit2.xcodeproj/project.pbxproj:-7626 > > > - 15739BBD1B42042D00D258C1 /* WebUserMediaClient.h in Headers */, > > > > This patch is doing a surprising about of xcodeproj reordering. > > I just ran sort-xcode-project.
Not usually recommended in a patch that is also doing other things (can make reverts more annoying than usual, especially). But, ok.
Matt Rajca
Comment 12
2015-08-04 16:55:29 PDT
Committed
r187917
: <
http://trac.webkit.org/changeset/187917
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug