Add QueryInterface helper macro for concrete class types

RESOLVED FIXED in Firefox 62

Status

()

enhancement
RESOLVED FIXED
Last year
Last year

People

(Reporter: kmag, Assigned: kmag)

Tracking

unspecified
mozilla62
Points:
---

Firefox Tracking Flags

(firefox62 fixed)

Details

Attachments

(1 attachment)

We have a log of QueryInterface methods which implement querying to concrete class types which can't be unambiguously cast to nsISupports, and need to be used with RefPtr/do_QueryObject. Those can't be implemented with existing helper macros, and as a result have several ad-hoc (sometimes slightly dodgy) implementations across the tree.

We should have a helper macro for this, and make sure that the logic that it implements is sane.
Comment on attachment 8979403 [details]
Bug 1463287: Add QueryInterface helper macro for concrete class types.

https://reviewboard.mozilla.org/r/245568/#review251656

r=me

I guess the various URI classes use hardcoded CID values which are not NS_GET_IID on the relevant class, which is why we can't use the macro for those?

I do think we can use it for nsDocLoader, though.
Attachment #8979403 - Flags: review?(bzbarsky) → review+
(In reply to Boris Zbarsky [:bz] (no decent commit message means r-) from comment #2)
> I guess the various URI classes use hardcoded CID values which are not
> NS_GET_IID on the relevant class, which is why we can't use the macro for
> those?

Right. Although we should probably fix that.

> I do think we can use it for nsDocLoader, though.

Yeah, that one didn't show up in my greps.
https://hg.mozilla.org/mozilla-central/rev/a1bf5dfd3c00
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.