Closed Bug 1632099 Opened 5 years ago Closed 5 years ago

do_QueryObject should work with const smart pointer

Categories

(Core :: XPCOM, defect)

defect

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: jya, Assigned: jya)

Details

Attachments

(2 files)

Right now, you can't do something like:

const nsCOMPtr<nsISupports> foo;
RefPtr<nsIInterface> blah = do_QueryObject(foo);

you must do:
RefPtr<nsIInterface> blah = do_QueryObject(foo.get());

no reason it couldn't be made to work.

It prevents converting easily methods that should have been declared as const.

Pushed by jyavenard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2a52ccc23e4e P1. Have nsQueryObject accept const smart pointers. r=froydnj https://hg.mozilla.org/integration/autoland/rev/15b83c404664 P2. Remove work around issue fixed in P1. r=froydnj
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: