RESOLVED FIXED 169140
WKWebView should provide a way for clients to know the specific media state.
https://bugs.webkit.org/show_bug.cgi?id=169140
Summary WKWebView should provide a way for clients to know the specific media state.
Andrew Gold
Reported 2017-03-03 12:15:01 PST
Currently, WKUIDelegate methods are called when a WKWebView begins/ends a capture session. Now, clients must know which specific devices are being used (microphone, camera, or both).
Attachments
Proposed patch. (16.46 KB, patch)
2017-03-06 18:29 PST, Andrew Gold
no flags
proposed patch v2. (22.86 KB, patch)
2017-03-07 13:43 PST, Andrew Gold
no flags
Proposed patch v3. (16.51 KB, patch)
2017-03-07 13:51 PST, Andrew Gold
no flags
Proposed patch v4. (13.56 KB, patch)
2017-03-07 15:21 PST, Andrew Gold
no flags
Jon Lee
Comment 1 2017-03-03 15:20:01 PST
Andrew Gold
Comment 2 2017-03-06 18:29:54 PST
Created attachment 303598 [details] Proposed patch.
WebKit Commit Bot
Comment 3 2017-03-06 18:31:06 PST
Attachment 303598 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h:42: Place brace on its own line for function definitions. [whitespace/braces] [4] Total errors found: 1 in 9 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jon Lee
Comment 4 2017-03-06 19:12:29 PST
Comment on attachment 303598 [details] Proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=303598&action=review > Source/WebKit2/ChangeLog:3 > + WKWebView should provide a way for client's to know the specific media state. No apostrophe. > Source/WebKit2/ChangeLog:4 > + https://bugs.webkit.org/show_bug.cgi?id=169140 Please include the Radar number. > Source/WebKit2/UIProcess/WebPageProxy.cpp:6455 > + if ((oldState & activeCaptureMask) != (m_mediaState & activeCaptureMask)) Isn't this just `if (oldMediaStateHasActiveCapture != newMediaStateHasActiveCapture)`?
Andrew Gold
Comment 5 2017-03-07 08:51:47 PST
(In reply to comment #4) > Comment on attachment 303598 [details] > Proposed patch. > > View in context: > https://bugs.webkit.org/attachment.cgi?id=303598&action=review > > > Source/WebKit2/ChangeLog:3 > > + WKWebView should provide a way for client's to know the specific media state. > > No apostrophe. Oops. > > > Source/WebKit2/ChangeLog:4 > > + https://bugs.webkit.org/show_bug.cgi?id=169140 > > Please include the Radar number. Done. > > > Source/WebKit2/UIProcess/WebPageProxy.cpp:6455 > > + if ((oldState & activeCaptureMask) != (m_mediaState & activeCaptureMask)) > > Isn't this just `if (oldMediaStateHasActiveCapture != > newMediaStateHasActiveCapture)`? No, because the MediaState may change for reasons other than a capture session beginning or ending (such as when audio/video starts playing).
Andrew Gold
Comment 6 2017-03-07 13:43:12 PST
Created attachment 303717 [details] proposed patch v2.
Andrew Gold
Comment 7 2017-03-07 13:48:26 PST
(In reply to comment #6) > Created attachment 303717 [details] > proposed patch v2. Ignore this. Wrong patch.
Andrew Gold
Comment 8 2017-03-07 13:51:41 PST
Created attachment 303720 [details] Proposed patch v3.
WebKit Commit Bot
Comment 9 2017-03-07 13:53:31 PST
Attachment 303720 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h:42: Place brace on its own line for function definitions. [whitespace/braces] [4] Total errors found: 1 in 9 files If any of these errors are false positives, please file a bug against check-webkit-style.
Andrew Gold
Comment 10 2017-03-07 13:57:15 PST
Andrew Gold
Comment 11 2017-03-07 14:48:18 PST
(In reply to comment #5) > (In reply to comment #4) > > Comment on attachment 303598 [details] > > Proposed patch. > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=303598&action=review > > > > > Source/WebKit2/ChangeLog:3 > > > + WKWebView should provide a way for client's to know the specific media state. > > > > No apostrophe. > > Oops. > > > > > > Source/WebKit2/ChangeLog:4 > > > + https://bugs.webkit.org/show_bug.cgi?id=169140 > > > > Please include the Radar number. > > Done. > > > > > > Source/WebKit2/UIProcess/WebPageProxy.cpp:6455 > > > + if ((oldState & activeCaptureMask) != (m_mediaState & activeCaptureMask)) > > > > Isn't this just `if (oldMediaStateHasActiveCapture != > > newMediaStateHasActiveCapture)`? > > No, because the MediaState may change for reasons other than a capture > session beginning or ending (such as when audio/video starts playing). I'm sorry, I misread this comment. You're right, that is the same. Will make this change, along with some others Alex and I discussed offline.
Andrew Gold
Comment 12 2017-03-07 15:21:01 PST
Created attachment 303735 [details] Proposed patch v4.
WebKit Commit Bot
Comment 13 2017-03-07 15:23:33 PST
Attachment 303735 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h:42: Place brace on its own line for function definitions. [whitespace/braces] [4] Total errors found: 1 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jon Lee
Comment 14 2017-03-07 20:28:30 PST
Comment on attachment 303735 [details] Proposed patch v4. r=me. WK2 review needed.
WebKit Commit Bot
Comment 15 2017-03-09 15:58:05 PST
Comment on attachment 303735 [details] Proposed patch v4. Clearing flags on attachment: 303735 Committed r213683: <http://trac.webkit.org/changeset/213683>
WebKit Commit Bot
Comment 16 2017-03-09 15:58:11 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.