Closed Bug 960694 Opened 11 years ago Closed 11 years ago

Support serializing JS implemented objects in nsBinaryOutputStream

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29
Tracking Status
firefox28 --- fixed
firefox29 --- fixed

People

(Reporter: jst, Assigned: jst)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

We ran into this in bug 911547 where we need to serialize a CSP object which is implemented in JS. The nsBinaryOutputStream calls GetClassIDNoAlloc() on the object's classinfo, which in this case is also a JS implemented object, and thus can not implement GetClassIDNoAlloc() (which is a [notxpcom] method). We probably want to keep calling GetClassIDNoAlloc(), cause it's faster and does exist in the common case, but if it fails, we should fall back on the scriptable method.
OS: Linux → All
Hardware: x86_64 → All
Attachment #8361259 - Flags: review?(benjamin)
Assignee: nobody → jst
FWIW, I'm trying a patch now which just replaces GetClassID with GetClassIDNoAlloc and makes that one scriptable (there's no reason it shouldn't be scriptable, from what I can see). We'll see whether it actually works and is scriptable in reality in a bit. If that doesn't pan out, this is fine.
Comment on attachment 8361259 [details] [diff] [review] Support writing out JS implemented classes. Yeah so, making this an nsIDRef gives the right signatures but xpconnect isn't prepared to handle it *and* currently doesn't distinguish between nsIDPtr and nsIDRef, which is strange. So land this as is and I'll see if I can unify them in a followup.
Attachment #8361259 - Flags: review?(benjamin) → review+
Target Milestone: --- → mozilla29
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Comment on attachment 8361259 [details] [diff] [review] Support writing out JS implemented classes. [Approval Request Comment] Bug caused by (feature/regressing bug #): prevents serialization of js-implemented xpcom objects. User impact if declined: can't uplift bug 911547. Testing completed (on m-c, etc.): landed on m-c Risk to taking this patch (and alternatives if risky): low risk; no js-implemented objects that are currently serialized exist in mozilla-aurora String or IDL/UUID changes made by this patch: none
Attachment #8361259 - Flags: approval-mozilla-aurora?
Attachment #8361259 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: