Commit Graph

189 Commits

Author SHA1 Message Date
Bobby Holley
97a5320a87 Bug 658909 - Remove GWNOJO from AccessCheck. r=mrbkap 2013-03-21 08:20:45 -07:00
Bobby Holley
19ea74e50b Bug 658909 - Make isSafeToUnwrap pseudo-dynamic for SOWs. r=mrbkap
This can go away as soon as XBL scopes are no longer behind a pref.
2013-03-21 08:20:41 -07:00
Ryan VanderMeulen
736320d2fd Backed out 22 changesets (bug 658909) for Windows debug bustage. 2013-03-21 15:24:54 -04:00
Bobby Holley
3eb6e189e8 Bug 658909 - Remove GWNOJO from AccessCheck. r=mrbkap 2013-03-21 08:20:45 -07:00
Bobby Holley
8dd1010edf Bug 658909 - Make isSafeToUnwrap pseudo-dynamic for SOWs. r=mrbkap
This can go away as soon as XBL scopes are no longer behind a pref.
2013-03-21 08:20:41 -07:00
Ms2ger
1e6c995090 Bug 845374 - Part l: Stop including nsIDocument.h in nsContentUtils.h and fix two nits; r=khuey 2013-03-17 08:55:15 +01:00
Bobby Holley
437a0a3edf Bug 836301 - Introduce an RAII class for entering policies. r=mrbkap
This will allow us to make some hard assertions that a given policy has been
entered exactly once.
2013-02-25 13:54:18 -08:00
Phil Ringnalda
b01d7591f9 Back out 4d301b2bcad0:e0632e639097 (bug 836301) for Windows build bustage
CLOSED TREE
2013-02-22 08:41:37 -08:00
Bobby Holley
d265a08311 Bug 836301 - Introduce an RAII class for entering policies. r=mrbkap
This will allow us to make some hard assertions that a given policy has been
entered exactly once.
2013-02-22 08:14:33 -08:00
Bobby Holley
574cc83a83 Bug 839867 - Align gecko with the spec on cross-origin access to Location.hash. r=bz
We update the tests to cover this case. There was also a bug in the tests where
we were accidentally testing non-writable Location properties against window
rather than window.location. :-(
2013-02-11 00:05:17 +01:00
Bobby Holley
56ce1b2c7c 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
Jeff Walden
6054ca7e90 Bug 823283 - Remove all remaining uses of JSRESOLVE_QUALIFIED, and the few remaining tests (which were pretty much purely diagnostic). r=luke 2012-09-15 11:19:55 -07:00
Bobby Holley
b60d7375ce Bug 809652 - Deny nativeCall for SecurityWrapper except under specific circumstances. r=jorendorff 2012-12-20 22:33:26 -08:00
Peter Van der Beken
f9974cb429 Fix for bug 815149 (Add support for SOWs and XBL bindings in new DOM bindings). r=bz. 2012-09-12 22:29:30 +02:00
Bobby Holley
c602a1cd62 Bug 818716 - Move XBL detection into nsContentUtils and remove filename hack. r=mrbkap 2012-12-12 17:09:37 -08:00
Bobby Holley
69f5bf9568 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
ece30f242d Bug 813901 - Throw COW exceptions in the wrapper's scope. r=mrbkap 2012-12-07 14:49:11 -08:00
Bobby Holley
0ffa276304 Bug 808608 - Remove specialized Location security wrappers. r=mrbkap 2012-11-21 13:20:05 -08:00
Bobby Holley
23af94cca4 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
8551660e5d Bug 800915 - Reimplement PUNCTURE consumers in terms of isSafeToUnwrap() and remove PUNCTURE API. r=mrbkap 2012-11-14 09:56:25 -08:00
Boris Zbarsky
3986f7846f 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
061eb53612 Bug 807179 - Add a constructor for JSPropertyDescriptor. r=luke 2012-11-05 17:49:44 -08:00
Bobby Holley
af592e6891 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
054fe781e2 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
218c41eee4 Backout 23c9f61a243b & 6ca11f4b470c (bug 805807) for mochitest-1 orange in test_contextmenu.html 2012-11-02 14:12:51 +00:00
Bobby Holley
6ff03ad05e 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
eb1ecb09da 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
Bobby Holley
ee1c5dff17 Bug 801576 - Forbid cross-origin access to the History object. r=mrbkap 2012-10-24 12:04:18 +02:00
Bobby Holley
52597d4211 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
Bobby Holley
79a18e9b01 Bug 795275 - Introduce an explicit mechanism for determining if a script is from XBL. r=mrbkap
We want this right now so that we can avoid the scary warning when content Components
access happens in XBL (which we're allowing going forward). This patch would be overkill
just for that, but I also have plans to introduce a SOW-like protection of the Components
wrapper filtering policy. I can't just do the filename hack for that though, because real-
world XBL filenames might be all over the place. So let's just be safe here.
2012-10-03 11:44:18 +02:00
Bobby Holley
2c03ca4fcb Bug 795275 - Clean up isSystemOnlyAccessPermitted. r=mrbkap
A lot of this stuff can be simplified now, and we can stop using the deprecated APIs.
2012-10-03 11:44:18 +02:00
Bobby Holley
e9b7cf0fb8 Bug 794912 - Remove dynamic privilege check in isCrossOriginAccessPermitted. r=mrbkap 2012-10-01 23:13:49 +02:00
Ms2ger
99fc95b55c Bug 792474 - Don't JS_ASSERT in xpconnect; rs=bholley 2012-09-20 09:55:37 +02:00
Bobby Holley
f91061e0cd Bug 789713 - Ignore domain when computing whether to share non-PreCreate WNs cross-compartment. r=mrbkap 2012-09-11 10:23:20 -07: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
Andrew Sutherland
7dff13e886 Bug 786639 - XPCChromeObjectWrapper __exposedProps__ should expose the content of typed arrays like UInt8Array. r=bholley 2012-09-05 14:05:32 -07:00
Bobby Holley
16049773f1 Bug 780370 - Remap objects from standard prototypes even if they're explicitly exposed. r=mrbkap 2012-08-23 19:07:14 -07:00
Luke Wagner
55107a5229 Bug 625199 - s/JSAutoEnterCompartment/JSAutoCompartment/ and make it infallible (r=bholley) 2012-08-21 18:42:53 -07:00
Luke Wagner
88c2971644 Bug 625199 - kill dummy frames (r=mrbkap) 2012-08-17 18:05:06 -07:00
Bobby Holley
0fc162f4b0 Bug 784233 - Relax __exposedProps__ check for sandboxes until we can repack AMO addons. r=gal 2012-08-21 10:27:08 -07:00