Closed
Bug 855700
Opened 12 years ago
Closed 12 years ago
Returning an nsIVariant from WebIDL doesn't work
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla23
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(1 file)
(deleted),
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
This is needed for bug 851542 for now until we have IDL arrays. But it might come up for something else too.
The basic problem is that we treat nsIVariant as an external interface, call dom::WrapObject<nsIVariant>, which calls dom::XPCOMObjectToJsval, which calls dom::NativeInterface2JSObjectAndThrowIfFailed, which calls XPCConvert::NativeInterface2JSObject.
And that fails, in a web page, because variants have no classinfo.
The point, of course, is we don't want to create a wrapper for a variant at all. Note that XPCConvert::NativeData2JS special-cases nsIVariant in the nsXPTType::T_INTERFACE case by calling XPCVariant::VariantDataToJS. We need to do something similar.
Assignee | ||
Comment 1•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → bzbarsky
Assignee | ||
Updated•12 years ago
|
Attachment #730682 -
Flags: feedback?(ted)
Assignee | ||
Updated•12 years ago
|
Whiteboard: [need review]
Assignee | ||
Updated•12 years ago
|
Attachment #730682 -
Flags: feedback?(ted) → review?(peterv)
Comment 2•12 years ago
|
||
This makes the patch in bug 851542 work for me.
Comment 3•12 years ago
|
||
Comment on attachment 730682 [details] [diff] [review]
Make returning an nsIVariant from a WebIDL interface work.
Exception handling is a bit ugly, but should at least be safe.
I don't think we handle exceptions too consistently with VariantDataToJS.
Attachment #730682 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 4•12 years ago
|
||
Flags: in-testsuite?
Whiteboard: [need review]
Target Milestone: --- → mozilla23
Comment 5•12 years ago
|
||
Hmm, looks like I'm getting crash because iid is null.
Comment 6•12 years ago
|
||
debug only assertion crash.
Comment 7•12 years ago
|
||
MOZ_ASSERT(!iid || iid->Equals(NS_GET_IID(nsIVariant)));
for now.
Assignee | ||
Comment 8•12 years ago
|
||
Does putting back the notflattened=True help?
Comment 9•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•