Closed
Bug 705333
Opened 13 years ago
Closed 13 years ago
Use IDL for nsJSCID::{CreateInstance,GetService}
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
mozilla11
People
(Reporter: Ms2ger, Assigned: Ms2ger)
References
Details
Attachments
(1 file)
8.29 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Attachment #576965 -
Flags: review?(bobbyholley+bmo)
Comment 1•13 years ago
|
||
Comment on attachment 576965 [details] [diff] [review] Patch v1 I'm really sorry for totally failing on my promise of speedy reviews. :-( Thanks for doing this stuff! >- nsISupports createInstance(); >- nsISupports getService(); >+ [implicit_jscontext,optional_argc] jsval createInstance([optional] in jsval iid); >+ [implicit_jscontext,optional_argc] jsval getService([optional] in jsval iid); It's good that you're using jsvals here, because I just wrote a patch that makes XPConnect throw on null IIDs: bug 705875. ;-) >- rv = xpc->WrapNativeToJSVal(cx, obj, inst, nsnull, iid, true, vp, nsnull); >- if (NS_FAILED(rv) || JSVAL_IS_PRIMITIVE(*vp)) >+ rv = nsXPConnect::GetXPConnect()->WrapNativeToJSVal(aCx, obj, inst, nsnull, iid, true, aRetval, nsnull); >+ if (NS_FAILED(rv) || JSVAL_IS_PRIMITIVE(*aRetval)) Can nsXPConnect::GetXPConnect() ever return null? We check for it before, and with this patch we don't. We should either keep checking or be very sure that it's safe. Same thing in getInterface(). r=bholley once that's figured out.
Attachment #576965 -
Flags: review?(bobbyholley+bmo) → review+
Comment 2•13 years ago
|
||
So, I realized that as much as I like the aFoo naming convention, it isn't consistent with js-style, and XPConnect is supposed to be js-style. So r+ contingent on changing that as well. :-(
Assignee | ||
Comment 3•13 years ago
|
||
nsXPConnect::GetXPConnect() certainly can't be null at that point; we would already have returned when the helper failed. (I doubt it can be null otherwise; maybe on shutdown?) https://hg.mozilla.org/mozilla-central/rev/f7c8894bbdae
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
You need to log in
before you can comment on or make changes to this bug.
Description
•