Closed
Bug 1034244
Opened 11 years ago
Closed 11 years ago
Improve handling of Xrayables in SpecialPowers.wrap
Categories
(Testing :: Mochitest, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla33
People
(Reporter: bholley, Assigned: bholley)
References
Details
Attachments
(4 files)
3.11 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
1.59 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
1.33 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
5.19 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
The current code in SpecialPowers.wrap makes various assumptions about XrayWrappers - in particular, that they don't have a meaningful prototype. This was true for XPCWrappedNative Xrays, but isn't really true for WebIDL Xrays (which have Xrayable prototypes), and definitely isn't true for JSXrays (which have HasPrototype=1). We should fix up this detection so that the wrappers work better.
Assignee | ||
Comment 1•11 years ago
|
||
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8451085 -
Flags: review?(gkrizsanits)
Assignee | ||
Comment 3•11 years ago
|
||
Our Xrays to TypedArrays basically just say "this will be slow - clone instead".
Let's just have SpecialPowers waive Xrays for them to make things work less
surprisingly.
Attachment #8451086 -
Flags: review?(gkrizsanits)
Assignee | ||
Comment 4•11 years ago
|
||
Comment on attachment 8451085 [details] [diff] [review]
Part 1 - Check only for WN Xrays when deciding whether the prototype is useless. v1
Gabor is on PTO, and I think Blake is actually a better reviewer here.
Attachment #8451085 -
Flags: review?(gkrizsanits) → review?(mrbkap)
Assignee | ||
Updated•11 years ago
|
Attachment #8451086 -
Flags: review?(gkrizsanits) → review?(mrbkap)
Assignee | ||
Comment 5•11 years ago
|
||
Attachment #8452799 -
Flags: review?(mrbkap)
Assignee | ||
Comment 6•11 years ago
|
||
Attachment #8452800 -
Flags: review?(mrbkap)
Updated•11 years ago
|
Attachment #8451085 -
Flags: review?(mrbkap) → review+
Comment 7•11 years ago
|
||
Comment on attachment 8451086 [details] [diff] [review]
Part 2 - Include TypedArrays in SpecialPowers Xray waiving list. v1
Review of attachment 8451086 [details] [diff] [review]:
-----------------------------------------------------------------
::: testing/specialpowers/content/specialpowersAPI.js
@@ +82,2 @@
> let className = Cu.getClassName(obj, true);
> + return arrayClasses.indexOf(className) != -1;
Yuck. Is there really no better way to do this? At the very least, a map might be worth it.
Attachment #8451086 -
Flags: review?(mrbkap) → review+
Updated•11 years ago
|
Attachment #8452799 -
Flags: review?(mrbkap) → review+
Updated•11 years ago
|
Attachment #8452800 -
Flags: review?(mrbkap) → review+
Assignee | ||
Comment 8•11 years ago
|
||
(In reply to Blake Kaplan (:mrbkap) from comment #7)
> Yuck. Is there really no better way to do this? At the very least, a map
> might be worth it.
Given that there are only 9 of them, I doubt that this imposes much overhead relative to all the other stuff that goes on here. Also, this stuff will all be simplified and rewritten with Direct Proxies at some point.
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/3b5651291f75
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/8e182aa529ab
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/c1d5d78aec3b
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/739be2b870b5
Comment 9•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/3b5651291f75
https://hg.mozilla.org/mozilla-central/rev/8e182aa529ab
https://hg.mozilla.org/mozilla-central/rev/c1d5d78aec3b
https://hg.mozilla.org/mozilla-central/rev/739be2b870b5
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in
before you can comment on or make changes to this bug.
Description
•