Closed Bug 1675118 Opened 4 years ago Closed 4 years ago

Add a variant of AsyncInvoker that supports posting completion runnables

Categories

(Core :: IPC: MSCOM, enhancement)

Unspecified
Windows
enhancement

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: bugzilla, Assigned: bugzilla)

Details

Attachments

(1 file)

This is to allow us to receive completion events from async COM interfaces without needing to block on anything.

I need this for some changes I want to make to Win32 file pickers.

  • We add an event-driven variant to mscom::AsyncInvoker. When the async call
    invokes ISynchronize::Signal, we post an event to the specified event
    target (or implicitly to the main thread).
  • For this to work, the async call needs to temporarily retain a reference to
    itself, otherwise the async call object is destroyed and the in-flight call
    is cancelled. This reference is stored in an "outer runnable" which is
    responsible for executing the inner completion runnable, and then dropping
    the self-reference.
  • We only run the completion runnable upon successful initiation of the async
    call. If there was a failure, we return that code immediately to the caller.
    Failures also clear the reference to the completion runnable.
  • If we could not obtain an async interface and must run synchronously, then
    we run the completion runnable immediately after a successful synchronous
    invocation.
Pushed by aklotz@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bb3aa2233400
Add a variant of mscom::AsyncInvoker that supports posting completion runnables; r=Jamie
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: