Bug 219972 - SpeechRecognitionRemoteRealtimeMediaSourceManager should not issue sandbox extension for mocked devices
Summary: SpeechRecognitionRemoteRealtimeMediaSourceManager should not issue sandbox ex...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sihui Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-12-16 19:52 PST by Sihui Liu
Modified: 2020-12-18 12:33 PST (History)
10 users (show)

See Also:


Attachments
Patch (11.71 KB, patch)
2020-12-16 19:58 PST, Sihui Liu
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (11.71 KB, patch)
2020-12-16 20:27 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch (11.71 KB, patch)
2020-12-17 09:12 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch for landing (13.51 KB, patch)
2020-12-18 11:33 PST, Sihui Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sihui Liu 2020-12-16 19:52:10 PST
...
Comment 1 Sihui Liu 2020-12-16 19:58:49 PST
Created attachment 416383 [details]
Patch
Comment 2 Sihui Liu 2020-12-16 20:27:42 PST
Created attachment 416387 [details]
Patch
Comment 3 Sihui Liu 2020-12-17 09:12:26 PST
Created attachment 416426 [details]
Patch
Comment 4 Eric Carlson 2020-12-17 15:06:36 PST
Comment on attachment 416426 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=416426&action=review

> Source/WebCore/platform/mediastream/CaptureDevice.h:70
> +    bool mocked() const { return m_mocked; }
> +    void setMocked(bool mocked) { m_mocked = mocked; }

Nit: I think `mockDevice` or `isMockDevice` would be better than `mocked`

> Source/WebCore/platform/mediastream/CaptureDevice.h:133
> +    bool m_mocked { false };

Is there any reason to not add this to the encoder and decoder methods?

> Source/WebKit/UIProcess/SpeechRecognitionRemoteRealtimeMediaSourceManager.h:76
> +    HashSet<WebCore::RealtimeMediaSourceIdentifier> m_sourcesNeedSandboxExtension;

Nit: `m_sourcesNeedingSandboxExtension` might be a better name.

> Source/WebKit/UIProcess/SpeechRecognitionServer.h:85
> +    SpeechRecognitionCheckIfMockSpeechRecognitionEnabled m_checkIfmockSpeechRecognitionEnabled;

s/m_checkIfmock/m_checkIfMock/
Comment 5 Sihui Liu 2020-12-18 09:12:15 PST
(In reply to Eric Carlson from comment #4)
> Comment on attachment 416426 [details]
> Patch

Thanks for the review!

> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=416426&action=review
> 
> > Source/WebCore/platform/mediastream/CaptureDevice.h:70
> > +    bool mocked() const { return m_mocked; }
> > +    void setMocked(bool mocked) { m_mocked = mocked; }
> 
> Nit: I think `mockDevice` or `isMockDevice` would be better than `mocked`

Will update.

> 
> > Source/WebCore/platform/mediastream/CaptureDevice.h:133
> > +    bool m_mocked { false };
> 
> Is there any reason to not add this to the encoder and decoder methods?

Nope, will add

> 
> > Source/WebKit/UIProcess/SpeechRecognitionRemoteRealtimeMediaSourceManager.h:76
> > +    HashSet<WebCore::RealtimeMediaSourceIdentifier> m_sourcesNeedSandboxExtension;
> 
> Nit: `m_sourcesNeedingSandboxExtension` might be a better name.

Will update!

> 
> > Source/WebKit/UIProcess/SpeechRecognitionServer.h:85
> > +    SpeechRecognitionCheckIfMockSpeechRecognitionEnabled m_checkIfmockSpeechRecognitionEnabled;
> 
> s/m_checkIfmock/m_checkIfMock/
Comment 6 Sihui Liu 2020-12-18 11:33:51 PST
Created attachment 416534 [details]
Patch for landing
Comment 7 EWS 2020-12-18 12:32:28 PST
Committed r270986: <https://trac.webkit.org/changeset/270986>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 416534 [details].
Comment 8 Radar WebKit Bug Importer 2020-12-18 12:33:20 PST
<rdar://problem/72477329>