Closed Bug 1495814 Opened 2 years ago Closed 2 years ago

Remove pointless do_QueryInterface() calls from nsBaseChannel.h

Categories

(Core :: Networking, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(1 file)

nsBaseChannel.h has two do_QueryInterface methods:

  // Helper function for calling QueryInterface on this.
  nsQueryInterface do_QueryInterface() {
    return nsQueryInterface(static_cast<nsIChannel *>(this));
  }
  // MSVC needs this:
  nsQueryInterface do_QueryInterface(nsISupports *obj) {
    return nsQueryInterface(obj);
  }

The first one is never called, and I'm pretty sure the second one can just be replaced by the do_QueryInterface that is defined in nsCOMPtr.h, so it should be easy to delete them.

My motivation is that I'm changing how nsQueryInterface works in bug 1493226 and I'd rather not have to change these two places.
The first QI is never used. The second one is the same as the one in
nsCOMPtr.h, so we should be able to call that instead, which can be
done simply by deleting the method. The motivation is that I'm
changing how do_QueryInterface works, and I'd like to avoid changing
this place given that it isn't actually needed.
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fc4e7aa8f23e
Remove pointless do_QueryInterface() functions from nsBaseChannel.h r=mayhemer
https://hg.mozilla.org/mozilla-central/rev/fc4e7aa8f23e
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.