Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 3c1fe40

Browse files
committed
Bug 1677212: Improved aIsProxy handling within mscom::AsyncInvoker; r=Jamie
I realized that calling `mscom::IsProxy` is kind of redundant when we already need to query for `ICallFactory`. We still allow `aIsProxy` as an optional constructor argument, but if not present then we go straight to `QueryInterface(IID_ICallFactory)`. Differential Revision: https://phabricator.services.mozilla.com/D97047
1 parent 075258e commit 3c1fe40

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

ipc/mscom/AsyncInvoker.h

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -370,17 +370,14 @@ class MOZ_RAII AsyncInvoker final : public WaitPolicy<AsyncInterface> {
370370
* performance penalty associated with that.
371371
*/
372372
explicit AsyncInvoker(SyncInterface* aSyncObj,
373-
const Maybe<bool>& aIsProxy = Nothing())
374-
: mSyncObj(ResolveIsProxy(aSyncObj, aIsProxy) ? nullptr : aSyncObj) {
373+
const Maybe<bool>& aIsProxy = Nothing()) {
375374
MOZ_ASSERT(aSyncObj);
376375

377-
if (mSyncObj) {
378-
return;
379-
}
380-
381376
RefPtr<ICallFactory> callFactory;
382-
if (FAILED(aSyncObj->QueryInterface(IID_ICallFactory,
377+
if ((aIsProxy.isSome() && !aIsProxy.value()) ||
378+
FAILED(aSyncObj->QueryInterface(IID_ICallFactory,
383379
getter_AddRefs(callFactory)))) {
380+
mSyncObj = aSyncObj;
384381
return;
385382
}
386383

@@ -435,13 +432,6 @@ class MOZ_RAII AsyncInvoker final : public WaitPolicy<AsyncInterface> {
435432
AsyncInvoker& operator=(const AsyncInvoker& aOther) = delete;
436433
AsyncInvoker& operator=(AsyncInvoker&& aOther) = delete;
437434

438-
private:
439-
static bool ResolveIsProxy(SyncInterface* aSyncObj,
440-
const Maybe<bool>& aIsProxy) {
441-
MOZ_ASSERT(aSyncObj);
442-
return aIsProxy.isSome() ? aIsProxy.value() : IsProxy(aSyncObj);
443-
}
444-
445435
private:
446436
RefPtr<SyncInterface> mSyncObj;
447437
};

0 commit comments

Comments
 (0)