Closed Bug 1495820 Opened 1 year ago Closed 1 year ago

Inline do_QueryWrappedNative()

Categories

(Core :: XPConnect, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(1 file, 1 obsolete file)

This method does almost nothing and is only used in a few places, so I think it is better to just delete it.

inline
const nsQueryInterface
do_QueryWrappedNative(nsIXPConnectWrappedNative *aWrappedNative)
{
    return nsQueryInterface(aWrappedNative->Native());
}

There's also a variant that returns an error, but it is completely unused.

Here's an example of what fixing a call site looks like:
-            !(cInterfaceID = do_QueryWrappedNative(wn))) {
+            !(cInterfaceID = do_QueryInterface(wn->Native()))) {

My immediate motivation is that bug 1493226 is changing how do_QueryInterface works, so with this then I don't have to mess around with as much code.
This method does very little, and is called in only a few places, so
just inline it. The error variant is not called at all. Simplifying
this makes it easier for me to change do_QueryInterface.
This method does very little, and is called in only a few places, so
just inline it. The error variant is not called at all. Simplifying
this makes it easier for me to change do_QueryInterface.
Attachment #9013794 - Attachment is obsolete: true
Priority: -- → P2
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9c6662e31204
Inline do_QueryWrappedNative() r=bzbarsky
https://hg.mozilla.org/mozilla-central/rev/9c6662e31204
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.