Commit Graph

226 Commits

Author SHA1 Message Date
Bobby Holley
f20eabe075 Bug 823348 - Stop checking for Xray waivers in the Xray machinery. r=mrbkap
All the casese where we want to waive should now be going through WaiveXrayWrapper.
2013-01-23 06:04:39 +01:00
Bobby Holley
c82ae67593 Bug 823348 - Replace security wrapper enumeration with a more rule-based approach. r=mrbkap 2013-01-23 06:04:39 +01:00
Bobby Holley
4b3c0f19a3 Bug 823348 - Hoist special cases to the top of WrapperFactory::Rewrap. r=mrbkap
This paves the way for more rule-based selection of wrappers in the common case.
2013-01-23 06:04:39 +01:00
Bobby Holley
6284ce3329 Bug 823348 - Move COW prototype remapping out of wrapper selection. r=mrbkap
It's pretty orthogonal, and makes the critical block more complicated than it
needs to be.
2013-01-23 06:04:39 +01:00
Bobby Holley
39970d33e6 Bug 823348 - Precompute various parameters in Rewrap. r=mrbkap
This is generally cleaner, and avoids potentially calling these functions
multiple times when we start moving this stuff around.
2013-01-23 06:04:39 +01:00
Bobby Holley
7124dc509b Bug 823348 - Use GetXrayType for content->chrome Xray wrappers. r=mrbkap
There's no reason to do this any different than we do for XOWs and such. The
only thing this might conceivably support would be certain chrome XPWNs-as-COWs.
But that would require that they forced a parent in precreate without being
flagged as DOM objects in classinfo. And it's not clear why we'd want to support
that. And we're generally moving away from COWs anyway.
2013-01-23 06:04:39 +01:00
Bobby Holley
1aedd25af4 Bug 823348 - Use EnsureCompartmentPrivate In Rewrap and stop checking for null. r=mrbkap 2013-01-23 06:04:39 +01:00
Bobby Holley
33983c1d00 Bug 823348 - Make NNXOWs use an explicitly opaque Policy. r=mrbkap
There's no reason to be doing a dynamic check here, given that the JSClasses
will never match. Lets be explicit and safe.
2013-01-23 06:04:38 +01:00
Bobby Holley
165e39b43e Bug 823348 - Do a better job of lying about the holder and make assertions fatal. r=mrbkap
I noticed this nonfatal assertion firing, unrelated to my patches. Leaking
the holder is not so great. Let's fix this for real.
2013-01-23 06:04:38 +01:00
Bobby Holley
ddf7e9edc1 Bug 823348 - Remove broken and unused __scriptOnly__ check. r=mrbkap
__scriptOnly__ is unused on mxr and addons-mxr. Morevoer, the current
implementation is totally broken, because we check for NNXOW, which only
happens when a random content JS object ends up in some other cross-origin
scope (via addons, presumably), whereas chrome objects use ChomeObjectWrapper.

I'm soon going to replace SCRIPT_ACCESS_ONLY with checked unwrapping, and mark
all COWs as unsafe to unwrap (see bug 821573 and bug 658909). So let's just kill
this thing here.
2013-01-23 06:04:38 +01:00
Boris Zbarsky
d53ec45102 Bug 823228 part 2. Move indexed property access on windows from nsWindowSH::GetProperty to the outer window proxy. r=bholley 2013-01-17 12:30:37 -05:00
Jeff Walden
da2a57bc92 Whitespace tab-killing patrol. No bug, r=sparky 2013-01-04 17:00:43 -06:00
Jeff Walden
be7908afa3 Bug 824217 - Make ChromeObjectWrapper::getPropertyDescriptor not pretend no descriptor exists when the property exists along the prototype chain, when the property is being resolved just before an assignment. r=bholley 2013-01-03 17:55:58 -06:00
Jeff Walden
d9889b3184 Bug 826447 - Change all the proxy API signatures to take unsigned flags, rather than bool set, so that it's easier to find all tests of JSRESOLVE_ASSIGNING. r=bz
--HG--
extra : rebase_source : 3b88b411965087984d7973a90f8fa1b06457a6ce
2013-01-03 15:31:36 -06:00
Jeff Walden
320df44ab6 Bug 823283 - Remove all remaining uses of JSRESOLVE_QUALIFIED, and the few remaining tests (which were pretty much purely diagnostic). r=luke
--HG--
extra : rebase_source : 51e2ac7ccc76be84d12600baeb6d458c2927bea7
2012-09-15 11:19:55 -07:00
Bobby Holley
2ca33ed4e3 Bug 809652 - Deny nativeCall for SecurityWrapper except under specific circumstances. r=jorendorff 2012-12-20 22:33:26 -08:00
Bobby Holley
60185d18f7 Bug 809652 - Have SecurityWrapper::enter default to deny, and override SecurityWrapper::objectClassIs. r=jorendorff 2012-12-20 22:33:26 -08:00
Peter Van der Beken
b208a08d09 Fix for bug 815149 (Add support for SOWs and XBL bindings in new DOM bindings). r=bz.
--HG--
extra : rebase_source : c24544fd3d1c99651e279e687a07a02c5b994323
2012-09-12 22:29:30 +02:00
Bobby Holley
3fcdd84451 Bug 818716 - Move XBL detection into nsContentUtils and remove filename hack. r=mrbkap 2012-12-12 17:09:37 -08:00
Saurabh Anand
c9e3659e16 Bug 818817 - Fix some compiler warnings, r=Ms2ger 2012-12-09 22:53:19 +05:30
Bobby Holley
2db9f70258 Bug 813901 - Validate __exposedProps__. r=mrbkap
This also involves modifying test_cows to deep clone in getCOW.
2012-12-07 14:49:11 -08:00
Bobby Holley
12044005c7 Bug 813901 - Throw COW exceptions in the wrapper's scope. r=mrbkap 2012-12-07 14:49:11 -08:00
Bobby Holley
8fdea45364 Bug 808608 - Remove Xray shadowing protection infrastructure. r=mrbkap
This is now unused.
2012-11-21 13:20:05 -08:00
Bobby Holley
f56e3f9249 Bug 808608 - Remove specialized Location security wrappers. r=mrbkap 2012-11-21 13:20:05 -08:00
Peter Van der Beken
4362399169 Fix for bug 811895 (Fix WN Xray special methods so they can take new DOM binding objects). r=bz.
--HG--
extra : rebase_source : 4b4ade0c3cddee9241e94f2e20216cee73a8e284
2012-09-26 16:17:51 +02:00
Bobby Holley
46b9d205df Bug 800915 - Remove the cx parameter and simplify various APIs. r=sfink,bz
If callers want to throw, it's now their responsibility.
2012-11-14 09:56:26 -08:00
Bobby Holley
1352e469d8 Bug 800915 - Reimplement PUNCTURE consumers in terms of isSafeToUnwrap() and remove PUNCTURE API. r=mrbkap 2012-11-14 09:56:25 -08:00
Bobby Holley
6eebf2b4d4 Bug 800915 - Add infrastructure to flag security wrappers as unsafe to unwrap. r=mrbkap 2012-11-14 09:56:25 -08:00
Bobby Holley
a36b720564 Bug 800915 - Clarify and refine the semantics of SecurityWrapper so that it is used if and only if unwrapping is unsafe. r=mrbkap
The naming scheme for Xray typedefs is the concatenation of the tuple:
({SC,}, {Security,Permissive}, Xray, {XPCWN,DOM}). This is admittedly a bit
much, but I think it's still better than explicitly doing the "typdef Foo Xray"
everywhere. Moreover, once the new DOM bindings are done, the last component
in the tuple will go away.
2012-11-14 09:56:25 -08:00
Bill McCloskey
89122b3c84 Bug 803376 - Allow wrappers to be reused (r=bholley) 2012-09-11 17:14:24 -07:00
Boris Zbarsky
f05491aec8 Bug 779048 part 0.5. Don't require a JSContext argument for nsJSUtils::GetStaticScriptGlobal. r=bholley 2012-11-09 07:43:57 -08:00
Bobby Holley
73334e2a83 Bug 805807 - Filter setters. r=mrbkap 2012-11-07 15:45:50 -08:00
Bobby Holley
0d4bc850b4 Bug 808611 - Move valueOf to nsIDOMLocation. r=mrbkap 2012-11-07 08:27:23 -08:00
Bobby Holley
327f8ca891 Bug 807179 - Add a constructor for JSPropertyDescriptor. r=luke 2012-11-05 17:49:44 -08:00
Boris Zbarsky
e0cb69bbd9 Bug 807548. Enumerating an Xray should not see the 'constructor' property on DOM prototypes unless we're told to include non-enumerable properties. r=peterv 2012-11-05 11:58:03 -05:00
Bobby Holley
8b06fa3c7e Bug 805807 - Rearchitect filtering policies so that check() doesn't throw on denial. r=mrbkap
This is another one of those annoying situaitons in XPConnect right now where we
can't ask a question without potentially throwing if the answer is no. There's
also a bunch of unused cruft in here (like the Perm*Access stuff), so this stuff
was ripe for a spring cleaning. Unfortunately, I wasn't able to divide this patch
up nicely. Sorry for the big diff. :-(

In a nutshell, this patch changes things so that Policy::check() just becomes
a predicate that says whether the access is allowed or not. There's the remote
possibility that one of the underlying JSAPI calls in a ::check() implementation
might throw, so callers to ::check() should check JS_IsExceptionPending
afterwards (this doesn't catch OOM, but we can just continue along until the
next OOM-triggering operation and throw there).

Aside from exceptional cases, callers should call Policy::deny if they want to
report the failure. Policy::deny returns success value that should be returned
to the wrapper's consumer.
2012-11-02 21:47:49 -03:00
Bobby Holley
c351c18d32 Bug 805807 - Make Components wrapper throw on denial. r=mrbkap
There's really no reason to use the wishy-washy static COW Deny() here.

Also, note that the xpcshell-test wasn't testing what it thought it
was - interfaces is accessible from content code.
2012-11-02 21:47:49 -03:00
Ed Morley
b159aab211 Backout 23c9f61a243b & 6ca11f4b470c (bug 805807) for mochitest-1 orange in test_contextmenu.html 2012-11-02 14:12:51 +00:00
Bobby Holley
2d408f61a6 Bug 805807 - Rearchitect filtering policies so that check() doesn't throw on denial. r=mrbkap
This is another one of those annoying situaitons in XPConnect right now where we
can't ask a question without potentially throwing if the answer is no. There's
also a bunch of unused cruft in here (like the Perm*Access stuff), so this stuff
was ripe for a spring cleaning. Unfortunately, I wasn't able to divide this patch
up nicely. Sorry for the big diff. :-(

In a nutshell, this patch changes things so that Policy::check() just becomes
a predicate that says whether the access is allowed or not. There's the remote
possibility that one of the underlying JSAPI calls in a ::check() implementation
might throw, so callers to ::check() should check JS_IsExceptionPending
afterwards (this doesn't catch OOM, but we can just continue along until the
next OOM-triggering operation and throw there).

Aside from exceptional cases, callers should call Policy::deny if they want to
report the failure. Policy::deny returns success value that should be returned
to the wrapper's consumer.
2012-11-02 13:27:59 +01:00
Bobby Holley
ac090a0e20 Bug 805807 - Make Components wrapper throw on denial. r=mrbkap
There's really no reason to use the wishy-washy static COW Deny() here.

Also, note that the xpcshell-test wasn't testing what it thought it
was - interfaces is accessible from content code.
2012-11-02 13:27:59 +01:00
Peter Van der Beken
1ef60a85a4 Fix for bug 778152 (Content window does not have an XMLHttpRequest property when accessed via an Xray wrapper in a subscript). r=bz.
Switch from using the interface objects from the Xrays compartment to wrapping
interface objects and interface prototype objects in Xrays. Make dom binding
Xrays deal with both instance objects and interface and interface prototype
objects.
2012-10-09 20:50:27 +02:00
Bobby Holley
b4461f0bed Bug 803068 - Merge DirectWrapper and Wrapper. r=ejpbruel
--HG--
extra : rebase_source : a2b98a9585c6f7761747cfaf55684e6eeed91344
2012-10-29 16:52:53 +01:00
Bobby Holley
8eabbd467b Bug 803068 - Manually grab the BaseProxyHandler derived traps in SandboxProxyHandler. r=ejpbruel
Let's just bite the bullet and do this here. It will let us get rid of
IndirectProxyHandler, which has really overcomplicated our proxy hierarchy.

--HG--
extra : rebase_source : 7e81529936bc256d672e40537eb6abca6374e52c
2012-10-29 16:52:53 +01:00
Bobby Holley
6bae1ef04d Bug 797821 - Address Ms2ger's review comments. r=me 2012-10-25 17:01:09 +02:00
Bobby Holley
c562949e50 Bug 797821 - Hoist XPConnect-y stuff out of the compartment private and into the XPCWrappedNativeScope. r=mrbkap
This change means we no longer have to keep around a set of XPConnect compartments.
We keep the compartment private around for non-xpconnecty stuff like about:memory
instrumentation that needs to happen on non-xpconnect compartments.
2012-10-25 17:01:09 +02:00
Bobby Holley
32af1d27d9 Bug 801576 - Forbid cross-origin access to the History object. r=mrbkap 2012-10-24 12:04:18 +02:00
Peter Van der Beken
0fca6b2112 Fix for bug 801083 (Remove old proxy-based list bindings). r=bz. 2012-10-13 14:50:24 +02:00
Bobby Holley
8f227813bb Bug 793969 - Define an identity transformation at the Xray layer. r=mrbkap 2012-10-19 21:00:48 +02:00
Isaac Aggrey
5d8d5083ea Bug 794510: Part 1 - Build with NO_NSPR_10_SUPPORT by default; r=ehsan,glandium,wtc 2012-10-11 01:00:54 -05:00
Bobby Holley
220736fd0b Bug 797204 - Consolidate XBL filename hack logic into nsContentUtils. r=mrbkap
These two functions do the exact same thing, as far as I can tell.
2012-10-10 11:01:26 +02:00