Commit Graph

483 Commits

Author SHA1 Message Date
Bobby Holley
232d5277c7 Bug 761695 - Make expando chain getting/setting a virtual trap. r=peterv 2012-10-05 18:59:23 +02:00
Bobby Holley
04dae362ab Bug 761695 - Hoist expando infrastructure into XrayTraits. r=peterv
It's still WN-only, now we can move the WN-only bits into virtual traps.

Note that the new-binding reparenting code will need to have a call to
CloneExpandoChain.
2012-10-05 18:59:23 +02:00
Bobby Holley
7fc6fea5b8 Bug 761695 - Hoist Xray identification machinery into XrayWrapper, and use it for trait identification. r=peterv
We don't currently have a good way of selecting the traits used by a given Xray
wrapper. This lets us do that.

Note: We add a call to js::UnwrapObject to GetXrayType while hoisting it. When
it was used only in WrapperFactory, this was unnecessary, because |obj| was
always unwrapped. But for our new purposes, it might not be. Aside from that,
there are no changes to the function.
2012-10-05 18:59:23 +02:00
Bobby Holley
bdc069fb1f Bug 761695 - Move Xray expando infrastructure further down in the file. r=peterv
Just cut/paste. No code changes.
2012-10-05 18:59:23 +02:00
Bobby Holley
036de25b0e Bug 761695 - Unify holder creation and access. r=peterv
With this patch, all holders are created lazily. There are two common accessors,
getHolder() and ensureHolder(). The former returns null if no holder exists, the
latter lazily creates the holder if it doesn't exist. It does this by calling into
a virtual trap on XrayTraits, which lets the appropriate Xray type do its thing.
2012-10-05 18:59:23 +02:00
Bobby Holley
719eea9d8a Bug 761695 - Get the WN directly from the wrapper. r=peterv
All this indirection was getting seriously mucky. This, incidentally, means that
the XPCWN holder no longer needs a reserved slot pointing to the WN.
2012-10-05 18:59:23 +02:00
Bobby Holley
a916f210c6 Bug 761695 - Hoist call and construct traps into Traits, since the current implementations are XPCWN-specific. r=peterv 2012-10-05 18:59:22 +02:00
Bobby Holley
0938208d73 Bug 761695 - Rename getInnerObject to getTargetObject. r=peterv
The current name potentially implies that the object returned is an inner
object in the JS sense, which isn't true. Really we just want the thing
we're Xraying to.
2012-10-05 18:59:22 +02:00
Bobby Holley
bdf300e2ac Bug 761695 - Hoist getInnerObject into XrayTraits. r=peterv
The only special handling here with wrapped natives is to make sure that we
bypass outer windows. But we can do this with js::UnwrapObject.
2012-10-05 18:59:22 +02:00
Bobby Holley
22dab70bae Bug 761695 - Make Xray traits inherit from a common superclass and give them a singleton instance. r=peterv
There's some code that can be shared between different Xray traits, but can't
(yet) be hoisted into XrayWrapper, because it needs to be callable from outside
XrayWrapper where we don't have the appropriate template parameters. Moreover,
this code benefits from virtual function specialization. The use case here is
illuminated in the next patch.

For the moment, we skip converting the bulk of the traits calls to virtual
methods, because they're working just fine.
2012-10-05 18:59:22 +02:00
Bobby Holley
5ea5980b83 Bug 761695 - Stop stashing a raw WN pointer in XPCWN Xray holders. r=peterv
We might as well do this dynamically, which simplifies the code. Note that we
could avoid the reserved slot by parenting the holder to the wrapper. But the
JS parent API is deprecated, and we need to move away from it to reserved slots
anyhow. We might as well start here, with the added advantage that parenting
to the global makes us consistent with the other Xray types.
2012-10-05 18:59:22 +02:00
Bobby Holley
14b762c11a Bug 761695 - Simplify XPCWN Xray holder creation. r=peterv
The major semantic change here is that we parent holders directly to their
global. This should be fine.
2012-10-05 18:59:22 +02:00
Bill McCloskey
a9639201b2 Bug 787856 - Convert JS_GetPrototype to support lazy protos (r=bhackett) 2012-09-03 16:42:17 -07:00
Bill McCloskey
d293598030 Bug 787856 - Convert js::GetObjectProto to support lazy protos (r=bhackett) 2012-09-03 16:42:10 -07:00
Ms2ger
99fc95b55c Bug 792474 - Don't JS_ASSERT in xpconnect; rs=bholley 2012-09-20 09:55:37 +02:00
Gabor Krizsanits
add46d17ab Bug 791845 - mozMatchesSelectorStub should return false on error. r=bholley 2012-09-19 10:53:42 +02:00
Bobby Holley
4e01324489 Bug 788914 - Kill the XOW flag. r=mrbkap
There are really two questions to be asked: is the caller chrome, and does the
caller subsume the callee. We have other, more precise ways of asking both of
these questions.
2012-09-11 01:05:10 -07:00
Bobby Holley
2371140fc5 Bug 788914 - Kill partially transparent wrappers. r=mrbkap 2012-09-11 01:05:10 -07:00
Bobby Holley
e1c1b7b3b3 Bug 788914 - Remove dynamic UniversalXPConnect checks sprinkled around the wrapper code. r=mrbkap 2012-09-11 01:05:10 -07:00
Ryan VanderMeulen
5185907444 Backout bug 788914 and bug 789494 because they were backed out on inbound. 2012-09-07 19:40:57 -04:00
Bobby Holley
cc55e49517 Bug 788914 - Kill the XOW flag. r=mrbkap
There are really two questions to be asked: is the caller chrome, and does the
caller subsume the callee. We have other, more precise ways of asking both of
these questions.
2012-09-07 11:28:56 -07:00
Bobby Holley
d713f9abcd Bug 788914 - Kill partially transparent wrappers. r=mrbkap 2012-09-07 11:28:56 -07:00
Bobby Holley
a9ebc61c32 Bug 788914 - Remove dynamic UniversalXPConnect checks sprinkled around the wrapper code. r=mrbkap 2012-09-07 11:28:56 -07:00
Ed Morley
e9d662c840 Backout 5853df66d488, e8fadd906232, d787279d282c, 8c1ed6327355, 94cfcf5da7c8, 87aa103d7e87 (bug 585922) for failures in test_bug411236.html 2012-09-07 09:15:34 +01:00
Bobby Holley
459935a850 Bug 788914 - Kill the XOW flag. r=mrbkap
There are really two questions to be asked: is the caller chrome, and does the
caller subsume the callee. We have other, more precise ways of asking both of
these questions.
2012-09-06 22:55:18 -07:00
Bobby Holley
3595e74d5e Bug 788914 - Kill partially transparent wrappers. r=mrbkap 2012-09-06 22:55:18 -07:00
Bobby Holley
6ff3e9262a Bug 788914 - Remove dynamic UniversalXPConnect checks sprinkled around the wrapper code. r=mrbkap 2012-09-06 22:55:18 -07:00
Gabor Krizsanits
c57341063d Bug 763897 - Incorrect behaviour of mozMatchesSelector.call through xray; r=bholley 2012-08-27 15:15:20 +02:00
Gabor Krizsanits
ccc43b6164 Bug 738244 - Supporting DOM specific collection properties through xray wrappers; r=mrbkap 2012-08-27 15:06:34 +02:00
Peter Van der Beken
f329503b85 Fix for bug 785188 (Make Xrays work with newest DOM list bindings). r=mrbkap. 2012-06-06 21:52:26 +02:00
Luke Wagner
55107a5229 Bug 625199 - s/JSAutoEnterCompartment/JSAutoCompartment/ and make it infallible (r=bholley) 2012-08-21 18:42:53 -07:00
Peter Van der Beken
2e8d72e06f Fix for bug 768692 (Move DOM list binding generation to the new DOM binding codegen). r=bzbarsky. 2012-05-22 15:46:20 +02:00
Ehsan Akhgari
7917f7709f Merge the nullptr conversion from mozilla-central into mozilla-inbound 2012-07-30 10:28:15 -04:00
Aryeh Gregor
8b4a23fc4c Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
Brian Hackett
6c4ed4bfd1 Use HandleValue and MutableHandleValue in API hooks where possible, bug 776579. r=billm, sr=dmandelin 2012-07-30 05:19:09 -06:00
Ehsan Akhgari
90cad18f5b Bug 776660 - Return null from EnsureExpandoObject instead of false; r=bholley 2012-07-23 15:58:41 -04:00
Bobby Holley
00a771e0d6 Bug 774245 - Add WrapperFactory and XrayWrapper machinery to allow same-compartment Xray wrapping. r=mrbkap 2012-07-18 13:51:28 +02:00
Gabor Krizsanits
df52ff6c23 Bug 771081 - part2: Rename CrossOriginWrapper files. r=gal 2012-07-16 19:22:51 +02:00
Bobby Holley
cb62886d78 Bug 655649 - Stop doing dynamic security checks for document.domain. r=mrbkap 2012-07-12 10:10:15 +02:00
Eddy Bruel
4efaf437bb Bug 771908 - Get rid of Wrapper::leave; r=bholley, sr=mrbkap 2012-07-11 14:01:10 +02:00
Eddy Bruel
8757f4a87f Bug 703537: Rename AbstractWrapper to IndirectWrapper + adding comments; r=bholley 2012-07-08 19:04:14 +02:00
Ehsan Akhgari
b3ca0b7712 Backout changeset 20b0bce4c165 (bug 703537) under the suspicion of breaking Linux32 mochitest-chrome without framepointers 2012-07-04 19:24:04 -04:00
Eddy Bruel
c210668ea7 Bug 703537 - Rename AbstractWrapper to IndirectWrapper; r=bholley 2012-07-04 01:20:35 +02:00
Bobby Holley
bc263edfd1 Bug 767306 - Temporarily make assertion from bug 766641 non-fatal. r=me 2012-06-22 12:01:18 +02:00
Bobby Holley
e2f3857460 Bug 763433 - Clarify compartment situation in Xray wrapper. r=mrbkap
Adding to the mess of the NodePrincipal (et al) check isn't great, but I'm refactoring that in bug 761704.
2012-06-18 15:47:09 +02:00
Bobby Holley
fad04808e5 Bug 763381 - Fix up compartment situation for expando objects. r=mrbkap 2012-06-18 15:28:11 +02:00
Bobby Holley
405597cd58 Bug 763381 - Pass cx around in more places. r=mrbkap 2012-06-18 15:28:11 +02:00
Bobby Holley
5a0c0cab62 Bug 758415 - Rip out old expando architecture. r=mrbkap 2012-06-05 19:07:37 +02:00
Bobby Holley
afed1aef96 Bug 758415 - Switch WN Xrays to use the new expando infrastructure. r=mrbkap 2012-06-05 19:07:37 +02:00
Bobby Holley
9e1e636aba Bug 758415 - Copy expando objects during object transplanting. r=mrbkap 2012-06-05 19:07:37 +02:00