Use IDL for jsdIDebuggerService::WrapValue and remove WrapJSValue

RESOLVED FIXED in mozilla11

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Tracking

({dev-doc-needed})

Trunk
mozilla11
dev-doc-needed
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
Created attachment 580119 [details] [diff] [review]
Patch v1

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?
(Assignee)

Comment 2

6 years ago
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+
(Assignee)

Updated

6 years ago
Depends on: 709747
(Assignee)

Comment 4

6 years ago
https://hg.mozilla.org/mozilla-central/rev/21fbcd2f27a8

d-d-n in case anybody used WrapJSValue.
Status: ASSIGNED → RESOLVED
Last Resolved: 6 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.