Closed Bug 1390159 Opened 8 years ago Closed 8 years ago

Can we remove the default throw-on-set setProperty Class hook?

Categories

(Core :: XPConnect, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Patch (obsolete) — Splinter Review
We want to remove the getProperty/setProperty ClassOps, see bug 1389510. XPConnect classes use the setProperty hook as follows (if XPC_SCRIPTABLE_WANT_SETPROPERTY is not set): (1) If XPC_SCRIPTABLE_USE_JSSTUB_FOR_SETPROPERTY is used, the setProperty hook is nullptr (DOM_BASE_SCRIPTABLE_FLAGS sets this flag). (2) Else, we use a hook that throws an exception (XPC_WN_MaybeResolvingSetPropertyStub or XPC_WN_CannotModifySetPropertyStub). The question is if (2) is necessary. bz said (bug 1389510 comment 3): > I'm not entirely sure whether we need these. We have these things like that > for addProperty already, which should cover the cases we really care about > here, I think. In particular, all consumers of > XPC_SCRIPTABLE_USE_JSSTUB_FOR_ADDPROPERTY also use > XPC_SCRIPTABLE_USE_JSSTUB_FOR_SETPROPERTY, so we can't have a case where > addProperty is nullptr but setProperty needs to be one of those stubs.... > I'm pretty sure we could just require that pattern and nuke these stubs, but > it might be worth double-checking with bholley or peterv in case I missed > something. I did a Try push that uses a nullptr setProperty hook instead of (2) and it's green.
Attachment #8897006 - Flags: review?(peterv)
Comment on attachment 8897006 [details] [diff] [review] Patch Stealing this review -- we don't need the setProperty hook because of the addProperty hook.
Attachment #8897006 - Flags: review?(peterv) → review+
Attached patch Patch with testSplinter Review
Attachment #8897006 - Attachment is obsolete: true
Attachment #8897590 - Flags: review+
Pushed by jandemooij@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/4ed300523cb0 Remove throw-on-set setProperty hooks on WrappedNatives. r=mrbkap
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: