Closed Bug 708754 Opened 13 years ago Closed 13 years ago

Use IDL for jsdIDebuggerService::WrapValue and remove WrapJSValue

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla11

People

(Reporter: Ms2ger, Assigned: Ms2ger)

References

Details

Attachments

(1 file)

Attached patch Patch v1Splinter Review
We can get rid of the nsAXPCNativeCallContext stuff, and WrapJSValue becomes rather redundant after that.
Attachment #580119 - Flags: review?(bobbyholley+bmo)
Comment on attachment 580119 [details] [diff] [review]
Patch v1


>-          nsCOMPtr<jsdIValue> jsdValue;
>-          jsd->WrapJSValue(v, getter_AddRefs(jsdValue));
>-          *aRetVal = jsdValue.forget().get();
>+          nsRefPtr<jsdIValue> jsdValue;
>+          rv = jsd->WrapValue(v, getter_AddRefs(jsdValue));
>+          NS_ENSURE_SUCCESS(rv, rv);
>+          jsdValue.forget(aRetVal);

Why the switch from nsCOMPtr to nsRefPtr here?
Because nsCOMPtr::forget can only be called with T**, while nsRefPtr's version is happy with superclasses. (Yes, silly, I know; that's Gecko for you.)
Comment on attachment 580119 [details] [diff] [review]
Patch v1

(In reply to Ms2ger from comment #2)
> Because nsCOMPtr::forget can only be called with T**, while nsRefPtr's
> version is happy with superclasses. (Yes, silly, I know; that's Gecko for
> you.)

Hm, in that case I'd rather fix nsCOMPtr (looks like it just needs a template<typename I>), or failing that use the slightly more awkward syntax we had here before. We might as well use COM pointers for COM objects.

r+ once that's taken care of.
Attachment #580119 - Flags: review?(bobbyholley+bmo) → review+
Depends on: 709747
https://hg.mozilla.org/mozilla-central/rev/21fbcd2f27a8

d-d-n in case anybody used WrapJSValue.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Keywords: dev-doc-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: