<?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>261720</bug_id>
          
          <creation_ts>2023-09-18 21:10:10 -0700</creation_ts>
          <short_desc>Give ability for IPC calls to work with NativePromise</short_desc>
          <delta_ts>2023-09-21 00:53:29 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Process Model</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=257934</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=261864</see_also>
          <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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jean-Yves Avenard [:jya]">jean-yves.avenard</reporter>
          <assigned_to name="Jean-Yves Avenard [:jya]">jean-yves.avenard</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1978198</commentid>
    <comment_count>0</comment_count>
    <who name="Jean-Yves Avenard [:jya]">jean-yves.avenard</who>
    <bug_when>2023-09-18 21:10:10 -0700</bug_when>
    <thetext>Would give the ability to instead of doing:

```
    m_connectionToWebProcess-&gt;connection().sendWithAsyncReply(Messages::MediaSourcePrivateRemote::WaitForTarget(target), WTFMove(completionHandler), m_identifier);
```

you could instead do:
```
    m_connectionToWebProcess-&gt;connection().sendWithPromisedReply(Messages::MediaSourcePrivateRemote::WaitForTarget(target), m_identifier)
    -&gt;whenSettled(runLoop, __func__, [] (MediaSourcePrivateRemote::WaitForTarget::Promise::Result&amp;&amp; result) {
        if (result)
            // do something with result.value()
        else
            // do something with result.error()
    });
```

this would also gives the ability to propagate the IPC error, see bug 257934

It also allows to guarantee on which thread the completionHandler will run once the IPC operation has returned its value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1978199</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-09-18 21:12:48 -0700</bug_when>
    <thetext>&lt;rdar://problem/115704438&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1978584</commentid>
    <comment_count>2</comment_count>
    <who name="Jean-Yves Avenard [:jya]">jean-yves.avenard</who>
    <bug_when>2023-09-20 00:45:36 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/17965</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1978920</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-09-21 00:53:26 -0700</bug_when>
    <thetext>Committed 268240@main (f997a9edb80c): &lt;https://commits.webkit.org/268240@main&gt;

Reviewed commits have been landed. Closing PR #17965 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>