Remove pointless do_QueryInterface() calls from nsBaseChannel.h

RESOLVED FIXED in Firefox 64

Status

()

enhancement
RESOLVED FIXED
8 months ago
8 months ago

People

(Reporter: mccr8, Assigned: mccr8)

Tracking

unspecified
mozilla64
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox64 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

8 months ago
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.
Assignee

Comment 1

8 months ago
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.

Comment 2

8 months ago
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fc4e7aa8f23e
Remove pointless do_QueryInterface() functions from nsBaseChannel.h r=mayhemer

Comment 3

8 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/fc4e7aa8f23e
Status: NEW → RESOLVED
Last Resolved: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.