Closed
Bug 984466
Opened 11 years ago
Closed 11 years ago
change CallQueryInterface to assert in cases of trivial conversions
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla31
People
(Reporter: froydnj, Assigned: froydnj)
Details
Attachments
(1 file)
(deleted),
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
We decided this would be a better thing to do that bug 983719.
Assignee | ||
Comment 1•11 years ago
|
||
Lots of small fixups; they all seem to be fallout from the
s/nsILocalFile/nsIFile/ conversion. Detecting conversions to superclasses
would be easy, I think, but we'll leave that as a followup.
Attachment #8392305 -
Flags: review?(ehsan)
Comment 2•11 years ago
|
||
Comment on attachment 8392305 [details] [diff] [review]
change CallQueryInterface to assert in cases of trivial conversions
Review of attachment 8392305 [details] [diff] [review]:
-----------------------------------------------------------------
::: xpcom/glue/nsISupportsUtils.h
@@ +132,5 @@
> + // We permit nsISupports-to-nsISupports here so that one can still obtain
> + // the canonical nsISupports pointer with CallQueryInterface.
> + static_assert(!mozilla::IsSame<T, DestinationType>::value ||
> + mozilla::IsSame<DestinationType, nsISupports>::value,
> + "don't use CallQueryInterface for compile-time-determinable casts");
I assume you have bsmedberg's blessing on this, but this looks sane.
Attachment #8392305 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 3•11 years ago
|
||
Yes, this did have Benjamin's blessing. :)
https://hg.mozilla.org/integration/mozilla-inbound/rev/e17405b3cc01
Flags: in-testsuite-
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → nfroyd
Comment 4•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in
before you can comment on or make changes to this bug.
Description
•