<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>169431</bug_id>
          
          <creation_ts>2017-03-09 12:54:02 -0800</creation_ts>
          <short_desc>[WK2][iOS] Extend WebProcess sandbox to support audio and video compression/decompression</short_desc>
          <delta_ts>2017-03-10 12:14:32 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit2</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>169480</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Brent Fulgham">bfulgham</reporter>
          <assigned_to name="Brent Fulgham">bfulgham</assigned_to>
          <cc>achristensen</cc>
    
    <cc>bfulgham</cc>
    
    <cc>commit-queue</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>jonlee</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1285484</commentid>
    <comment_count>0</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2017-03-09 12:54:02 -0800</bug_when>
    <thetext>The iOS web  process needs access to the following Mach names in order to compress, decompress, and render audio and video for WebRTC:

These are needed to decode video content delivered over WebRTC:
com.apple.coremedia.videoqueue
com.apple.audio.audiohald
com.apple.coremedia.decompressionsession

This is needed to encode video to ship over WebRTC:
com.apple.coremedia.compressionsession</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1285485</commentid>
    <comment_count>1</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2017-03-09 12:54:35 -0800</bug_when>
    <thetext>&lt;rdar://problem/30844650&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1285491</commentid>
    <comment_count>2</comment_count>
      <attachid>303960</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2017-03-09 12:57:22 -0800</bug_when>
    <thetext>Created attachment 303960
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1285511</commentid>
    <comment_count>3</comment_count>
      <attachid>303960</attachid>
    <who name="youenn fablet">youennf</who>
    <bug_when>2017-03-09 13:09:03 -0800</bug_when>
    <thetext>Comment on attachment 303960
Patch

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

&gt; Source/WebKit2/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:116
&gt; +    (allow mach-lookup (global-name &quot;com.apple.coremedia.compressionsession&quot;)))

We need compressionsession when doing exporting canvas through peer connection, not only for gum.
I would add it next to decompressionsession.

&gt; Source/WebKit2/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:141
&gt; +    (global-name &quot;com.apple.audio.audiohald&quot;)

I wonder whether we can put this one under com.apple.webkit.microphone?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1285519</commentid>
    <comment_count>4</comment_count>
      <attachid>303960</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2017-03-09 13:13:26 -0800</bug_when>
    <thetext>Comment on attachment 303960
Patch

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

&gt;&gt; Source/WebKit2/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:116
&gt;&gt; +    (allow mach-lookup (global-name &quot;com.apple.coremedia.compressionsession&quot;)))
&gt; 
&gt; We need compressionsession when doing exporting canvas through peer connection, not only for gum.
&gt; I would add it next to decompressionsession.

We need this for microphone OR camera, but not otherwise. So I think this is correct (it&apos;s safe to tell the Sandbox to allow a particular mach name more than once).

&gt;&gt; Source/WebKit2/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:141
&gt;&gt; +    (global-name &quot;com.apple.audio.audiohald&quot;)
&gt; 
&gt; I wonder whether we can put this one under com.apple.webkit.microphone?

Eric said it was needed for incoming video streams (which I assume include audio?), so I put it here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1285551</commentid>
    <comment_count>5</comment_count>
      <attachid>303960</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2017-03-09 13:42:07 -0800</bug_when>
    <thetext>Comment on attachment 303960
Patch

Clearing flags on attachment: 303960

Committed r213665: &lt;http://trac.webkit.org/changeset/213665&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1285552</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2017-03-09 13:42:11 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1285806</commentid>
    <comment_count>7</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2017-03-10 08:02:21 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; Comment on attachment 303960 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=303960&amp;action=review
&gt; 
&gt; &gt;&gt; Source/WebKit2/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:116
&gt; &gt;&gt; +    (allow mach-lookup (global-name &quot;com.apple.coremedia.compressionsession&quot;)))
&gt; &gt; 
&gt; &gt; We need compressionsession when doing exporting canvas through peer connection, not only for gum.
&gt; &gt; I would add it next to decompressionsession.
&gt; 
&gt; We need this for microphone OR camera, but not otherwise. So I think this is
&gt; correct (it&apos;s safe to tell the Sandbox to allow a particular mach name more
&gt; than once).

We also need it when no microphone and no camera,: canvas is exported to a mediastream track which is then sent to peer connection.
Can you update the patch?
&gt; 
&gt; &gt;&gt; Source/WebKit2/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:141
&gt; &gt;&gt; +    (global-name &quot;com.apple.audio.audiohald&quot;)
&gt; &gt; 
&gt; &gt; I wonder whether we can put this one under com.apple.webkit.microphone?
&gt; 
&gt; Eric said it was needed for incoming video streams (which I assume include
&gt; audio?), so I put it here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1285807</commentid>
    <comment_count>8</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2017-03-10 08:03:35 -0800</bug_when>
    <thetext>See https://youennf.github.io/webrtc-tests/src/content/capture/canvas-pc2/ as an example</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>303960</attachid>
            <date>2017-03-09 12:57:22 -0800</date>
            <delta_ts>2017-03-09 13:42:07 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-169431-20170309125721.patch</filename>
            <type>text/plain</type>
            <size>2512</size>
            <attacher name="Brent Fulgham">bfulgham</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJLaXQyL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
S2l0Mi9DaGFuZ2VMb2cJKHJldmlzaW9uIDIxMzY1NikKKysrIFNvdXJjZS9XZWJLaXQyL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDEzIEBACisyMDE3LTAzLTA5ICBCcmVudCBG
dWxnaGFtICA8YmZ1bGdoYW1AYXBwbGUuY29tPgorCisgICAgICAgIFtXSzJdW2lPU10gRXh0ZW5k
IFdlYlByb2Nlc3Mgc2FuZGJveCB0byBzdXBwb3J0IGF1ZGlvIG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c2lzdGFudCIpKQorICAgICAgICAoZ2xvYmFsLW5hbWUgImNvbS5hcHBsZS5J
SURDQXNzaXN0YW50IikKKyAgICAgICAgKGdsb2JhbC1uYW1lICJjb20uYXBwbGUuY29yZW1lZGlh
LmNvbXByZXNzaW9uc2Vzc2lvbiIpKQogICAgIChhbGxvdyBpb2tpdC1vcGVuCiAgICAgICAgIDs7
IFF1aWNrVGltZVVTQlZEQ0RpZ2l0aXplcgogICAgICAgICAoaW9raXQtdXNlci1jbGllbnQtY2xh
c3MgIklPVVNCRGV2aWNlVXNlckNsaWVudFYyIikKICAgICAgICAgKGlva2l0LXVzZXItY2xpZW50
LWNsYXNzICJJT1VTQkludGVyZmFjZVVzZXJDbGllbnRWMiIpKQogICAgIChhbGxvdyBkZXZpY2Ut
Y2FtZXJhKSkKKworOzsgU3VwcG9ydCBpbmNvbWluZyB2aWRlbyBjb25uZWN0aW9ucworKGFsbG93
IG1hY2gtbG9va3VwCisgICAgKGdsb2JhbC1uYW1lICJjb20uYXBwbGUuYXVkaW8uYXVkaW9oYWxk
IikKKyAgICAoZ2xvYmFsLW5hbWUgImNvbS5hcHBsZS5jb3JlbWVkaWEuZGVjb21wcmVzc2lvbnNl
c3Npb24iKQorICAgIChnbG9iYWwtbmFtZSAiY29tLmFwcGxlLmNvcmVtZWRpYS52aWRlb3F1ZXVl
IikpCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>