Closed Bug 1437606 Opened 8 years ago Closed 8 years ago

tidy up QI implementations in libpref

Categories

(Core :: Preferences: Backend, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(2 files)

No description provided.
This construct is nicer than NS_INTERFACE_MAP_BEGIN and assures the reader there's no weirdness in the QI implementation. This change does mean that PGO doesn't get an opportunity to measure the frequency of which interfaces are QI'd most often. I think this is probably an OK tradeoff to make, given the prevalence of NS_IMPL_QUERY_INTERFACE elsewhere in the codebase. The one thing we have to ensure with this change is that the ambiguous QI to nsISupports uses the proper class after the change. The NS_IMPL_QUERY_INTERFACE macro chooses the first interface listed to disambiguate the cast to nsISupports.
Attachment #8950292 - Flags: review?(n.nethercote)
Now that we've used the standard NS_IMPL_QUERY_INTERFACE macro, we can start using the even more standard NS_IMPL_ISUPPORTS macro.
Attachment #8950293 - Flags: review?(n.nethercote)
Attachment #8950292 - Flags: review?(n.nethercote) → review+
Comment on attachment 8950293 [details] [diff] [review] part 2 - use NS_IMPL_ISUPPORTS in modules/libpref/ Review of attachment 8950293 [details] [diff] [review]: ----------------------------------------------------------------- This is one case where I think folding the two patches together would make them easier to understand :)
Attachment #8950293 - Flags: review?(n.nethercote) → review+
(In reply to Nicholas Nethercote [:njn] from comment #3) > This is one case where I think folding the two patches together would make > them easier to understand :) Maybe so. For the xpconnect version (bug 1437605), it seemed easier to split them up, because it was easier to verify that the ambiguous nsISupports cast was in the right place. But I guess here, that was less of a concern.
It's not a big deal either way.
Pushed by nfroyd@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/98c4ffa07c96 part 1 - use NS_IMPL_QUERY_INTERFACE in modules/libpref/; r=njn https://hg.mozilla.org/integration/mozilla-inbound/rev/0541e57dfa18 part 2 - use NS_IMPL_ISUPPORTS in modules/libpref/; r=njn
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: