WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
170814
[MediaStream] Push capabilities across process boundary during UIProcess capture.
https://bugs.webkit.org/show_bug.cgi?id=170814
Summary
[MediaStream] Push capabilities across process boundary during UIProcess capt...
Jer Noble
Reported
2017-04-13 10:49:40 PDT
[MediaSource] Push capabilities across process boundary during UIProcess capture.
Attachments
Patch
(32.60 KB, patch)
2017-04-13 11:12 PDT
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch
(32.14 KB, patch)
2017-04-13 11:29 PDT
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch
(33.32 KB, patch)
2017-04-13 11:37 PDT
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch for landing
(33.32 KB, patch)
2017-04-13 12:14 PDT
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch for landing
(33.37 KB, patch)
2017-04-13 12:30 PDT
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch for landing
(33.85 KB, patch)
2017-04-13 14:48 PDT
,
Jer Noble
achristensen
: review+
Details
Formatted Diff
Diff
Patch for landing
(42.95 KB, patch)
2017-04-13 18:13 PDT
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch for landing
(42.91 KB, patch)
2017-04-14 08:08 PDT
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Jer Noble
Comment 1
2017-04-13 11:12:17 PDT
Created
attachment 306998
[details]
Patch
Jer Noble
Comment 2
2017-04-13 11:29:24 PDT
Created
attachment 306999
[details]
Patch
Jer Noble
Comment 3
2017-04-13 11:37:28 PDT
Created
attachment 307002
[details]
Patch
Eric Carlson
Comment 4
2017-04-13 11:39:42 PDT
Comment on
attachment 307002
[details]
Patch Looks fine to me, but a real WK2 reviewer will have to give it an official r+.
Jer Noble
Comment 5
2017-04-13 12:14:32 PDT
Created
attachment 307011
[details]
Patch for landing
Jer Noble
Comment 6
2017-04-13 12:30:49 PDT
Created
attachment 307012
[details]
Patch for landing
Jon Lee
Comment 7
2017-04-13 13:28:28 PDT
rdar://problem/31435730
Alex Christensen
Comment 8
2017-04-13 13:30:47 PDT
Comment on
attachment 307012
[details]
Patch for landing View in context:
https://bugs.webkit.org/attachment.cgi?id=307012&action=review
> Source/WebCore/platform/mediastream/RealtimeMediaSourceCapabilities.h:133 > + RealtimeMediaSourceCapabilities() > + { > + }
= default;
> Source/WebKit2/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:152 > +void UserMediaCaptureManagerProxy::capabilities(uint64_t id, std::optional<WebCore::RealtimeMediaSourceCapabilities>& capabilities)
Why not just return a std::optional?
> Source/WebKit2/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:161 > + else > + capabilities = std::nullopt;
Is it necessary to set capabilities to nullopt here? If so, why isn't it done in the early return?
> Source/WebKit2/WebProcess/cocoa/UserMediaCaptureManager.cpp:144 > + mutable bool m_capabilitiesInitialized { false }; > + mutable std::optional<RealtimeMediaSourceCapabilities> m_capabilities;
This is very strange. std::optional keeps track of whether it is initialized. If you need more states than that, use WTF::Expected.
> Source/WebKit2/WebProcess/cocoa/UserMediaCaptureManager.cpp:250 > + m_process.sendSync(Messages::UserMediaCaptureManagerProxy::Capabilities(id), Messages::UserMediaCaptureManagerProxy::Capabilities::Reply(capabilities), 0);
Why do we need to add another sync message?
Jer Noble
Comment 9
2017-04-13 14:16:08 PDT
(In reply to Alex Christensen from
comment #8
)
> Comment on
attachment 307012
[details]
> Patch for landing > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=307012&action=review
> > > Source/WebCore/platform/mediastream/RealtimeMediaSourceCapabilities.h:133 > > + RealtimeMediaSourceCapabilities() > > + { > > + } > > = default;
Ok.
> > Source/WebKit2/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:152 > > +void UserMediaCaptureManagerProxy::capabilities(uint64_t id, std::optional<WebCore::RealtimeMediaSourceCapabilities>& capabilities) > > Why not just return a std::optional?
Because that makes the message binding code super unhappy.
> > Source/WebKit2/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:161 > > + else > > + capabilities = std::nullopt; > > Is it necessary to set capabilities to nullopt here? If so, why isn't it > done in the early return?
Yes.
> > Source/WebKit2/WebProcess/cocoa/UserMediaCaptureManager.cpp:144 > > + mutable bool m_capabilitiesInitialized { false }; > > + mutable std::optional<RealtimeMediaSourceCapabilities> m_capabilities; > > This is very strange. std::optional keeps track of whether it is > initialized. If you need more states than that, use WTF::Expected.
Alex and I discussed offline and I may have managed to convince him that std::optional<std::unique_ptr<Capabilities>> is OK.
> > Source/WebKit2/WebProcess/cocoa/UserMediaCaptureManager.cpp:250 > > + m_process.sendSync(Messages::UserMediaCaptureManagerProxy::Capabilities(id), Messages::UserMediaCaptureManagerProxy::Capabilities::Reply(capabilities), 0); > > Why do we need to add another sync message?
Because the caller expects to receive a reply synchronously.
Jer Noble
Comment 10
2017-04-13 14:48:00 PDT
Created
attachment 307028
[details]
Patch for landing
Jer Noble
Comment 11
2017-04-13 18:13:49 PDT
Created
attachment 307064
[details]
Patch for landing After discussing this with other members of the WebKit team, it became apparent that the best option was to remove the possibility of returning nullptr from RealtimeMediaSource::capabilities().
Jer Noble
Comment 12
2017-04-14 08:08:06 PDT
Created
attachment 307113
[details]
Patch for landing One last version to make the GTK bts happy.
WebKit Commit Bot
Comment 13
2017-04-14 09:04:55 PDT
Comment on
attachment 307113
[details]
Patch for landing Clearing flags on attachment: 307113 Committed
r215362
: <
http://trac.webkit.org/changeset/215362
>
Sam Weinig
Comment 14
2017-04-18 19:36:07 PDT
(In reply to Jer Noble from
comment #9
)
> (In reply to Alex Christensen from
comment #8
) > > Comment on
attachment 307012
[details]
> > Patch for landing > > > Source/WebKit2/WebProcess/cocoa/UserMediaCaptureManager.cpp:250 > > > + m_process.sendSync(Messages::UserMediaCaptureManagerProxy::Capabilities(id), Messages::UserMediaCaptureManagerProxy::Capabilities::Reply(capabilities), 0); > > > > Why do we need to add another sync message? > > Because the caller expects to receive a reply synchronously.
Can you go into more detail about this? Adding more synchronous calls is something that should be taken very seriously, and all alternatives should be discussed before going forward with it. Why can't capabilities be pushed to the WebProcess proactively when the source is created?
Maciej Stachowiak
Comment 15
2020-06-01 14:55:43 PDT
Comment on
attachment 307002
[details]
Patch Unflagging and obsoleting, since there is a newer patch for landing.
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