Closed Bug 1782536 Opened 2 years ago Closed 2 years ago

Remove outdated comment about deriving nsIInterfaceRequestor first

Categories

(Core :: Networking, task, P3)

task

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: manuel, Assigned: u711051, Mentored)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

Outdated comments:

From discussion on matrix:

manuel:

There is a note in HttpChannelParent and ParentChannelListener, that nsIInterfaceRequestor has to be the first derived class:

Note: nsIInterfaceRequestor must be the first base so that do_QueryObject()
works correctly on this object, as it's needed to compute a void* pointing to
the beginning of this object. [1][2]

But other classes like nsDocShellTreeOwner[3] don't derive nsIInterfaceRequestor as their first base. Is the comment obsolete, specific to HttpChannelParent or should the other classes also derive nsIInterfaceRequestor as their first base? I coundn't find a comment in nsIInterfaceRequestor.idl[4] stating such a requirement.

valentin:

I think that comment comes from this: https://bugzilla.mozilla.org/page.cgi?id=splinter.html&ignore=&bug=1219469&attachment=8703054

if (aIID.Equals(NS_GET_IID(HttpChannelParentListener))) {
  foundInterface = static_cast<nsIInterfaceRequestor*>(this);	
} else

So it used to be that it got the queryObject pointer by casting to nsIInterfaceRequestor - that's no longer the case, so we can probably remove that comment. Feel free to file a bug for it.

Assigning to Sunil as a good first bug.
Thank you for the report, Manuel.

Assignee: nobody → sunilmayya
Mentor: valentin.gosu
Status: NEW → ASSIGNED
Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/47dbad9f3ace
Remove outdated comments from HttpChannelParent.h and ParentChannelListener.h r=necko-reviewers,valentin DONTBUILD
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: