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.
Created attachment 258180 [details] Patch
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.
Created attachment 258184 [details] Patch
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.
Created attachment 258191 [details] Patch
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.
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.
(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.
Created attachment 258233 [details] Patch
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.
(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.
Committed r187917: <http://trac.webkit.org/changeset/187917>