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

RESOLVED FIXED in Firefox 57

Status

()

RESOLVED FIXED
a year ago
a year ago

People

(Reporter: jandem, Assigned: jandem)

Tracking

unspecified
mozilla57
Points:
---

Firefox Tracking Flags

(firefox57 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

a year ago
Created attachment 8897006 [details] [diff] [review]
Patch

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

Comment 2

a year ago
Created attachment 8897590 [details] [diff] [review]
Patch with test
Attachment #8897006 - Attachment is obsolete: true
Attachment #8897590 - Flags: review+

Comment 3

a year ago
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4ed300523cb0
Remove throw-on-set setProperty hooks on WrappedNatives. r=mrbkap

Comment 4

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/4ed300523cb0
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
status-firefox57: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.