Closed Bug 1344798 Opened 7 years ago Closed 7 years ago

Improvements to mscom::AsyncInvoker

Categories

(Core :: IPC, enhancement)

Unspecified
Windows
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox54 --- wontfix
firefox55 --- fixed

People

(Reporter: bugzilla, Assigned: bugzilla)

References

Details

Attachments

(1 file)

When implementing an async call using mscom::AsyncInvoker, it became clear that some improvements needed to be made to the interface.

In particular, it could be possible in a11y to have a pointer to an interface that may or may not be a proxy. That would force us to do something like this:

IFoo* myInterface = ...;

if (IsProxy(myInterface)) {
  ASYNC_INVOKER_FOR(IFoo) invoker(myInterface);
  hr = invoker.Begin_Bar(param1, param2);
} else {
  hr = myInterface->Bar(param1, param2);
}

Which is messy and hard to maintain.

Instead I'm moving that into the AsyncInvoker itself, so that it may just do the right thing depending on whether or not it has an async interface.

Now we can do this:

ASYNC_INVOKER_FOR(IFoo) invoker(myInterface);
hr = ASYNC_INVOKE(myInterface, Bar, param1, param2);

and it just works. It's type-safe too!
Whoops, that last sample line of code should be:

hr = ASYNC_INVOKE(invoker, Bar, param1, param2);
Attachment #8844077 - Flags: review?(jmathies) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/04b7515972841369d3efc5abc275cdf30b5da143
Bug 1344798: Allow mscom::AsyncInvoker to be able to handle proxied and non-proxied interfaces; r=jimm
https://hg.mozilla.org/mozilla-central/rev/04b751597284
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: