Commit Graph

312 Commits

Author SHA1 Message Date
Ryan VanderMeulen
2a8d53f50d Merge m-c to inbound 2012-06-10 21:34:50 -04:00
L. David Baron
c9bf4416ea Backout bug 754202 (all patches, rather than just patches 3-7). 2012-06-10 17:22:31 -07:00
Ryan VanderMeulen
9aae70bdc5 Backout 90107a2a0c64 (bug 754202) for real due to orange. 2012-06-10 19:46:20 -04:00
Ryan VanderMeulen
891e38e528 Revert c39d36167b99 due to a horribly munged backout. 2012-06-10 19:44:50 -04:00
Ryan VanderMeulen
f497d31a0a Backout the bug 754202 backout due to orange. 2012-06-10 19:37:47 -04:00
Bobby Holley
68eb3e6ff0 Merge backout. 2012-06-11 00:28:30 +02:00
Bobby Holley
cf84d58a9f Back out bug 754202. r=me 2012-06-11 00:28:05 +02:00
Ms2ger
46fbdc5ce2 Bug 734891 - Followup: Fix build warnings in nsPrincipal.cpp. 2012-06-10 21:25:17 +02:00
Gabor Krizsanits
c7cd6fa21b Bug 734891 - part 2: Adding ExpandedPrincipal support 2012-06-09 15:19:26 -07:00
Gabor Krizsanits
04bfeb225f Bug 734891 - part 1: Decoupling URI based logic from caps/certificate related logic of nsPrincipal 2012-06-09 15:19:26 -07:00
Gabor Krizsanits
ea1269eb43 Bug 734891 - part 0: rearanging nsPrincipal methods for follow up 2012-06-09 15:19:26 -07:00
Bobby Holley
e4d8cf285c Bug 754202 - Remove mContextPrincipal usage from within nsScriptSecurityManager. r=mrbkap 2012-06-07 14:28:22 +02:00
Bobby Holley
a2ec0f4f20 Bug 754202 - Remove context pushing/popping API. r=mrbkap
Each one of these uses grabs the principal off of an object for pushing, but also enters the compartment of that object. So we shouldn't need this anymore.

Can I get a 'hell yeah'?
2012-06-07 14:28:21 +02:00
Bobby Holley
14f7c293ba Bug 754202 - Pull subject principals directly off the compartment. r=mrbkap
It would be nice to check these principals against the principals acquired
using the old mechanism. Unfortunately, they often differ. Because CAPS uses
JS stack frames, any time we enter a compartment and do an operation (even
throwing an Access-Denied exception) without running any JS code, we'll end
up with a different principal.

Our security story is pretty darn tied to compartments at this point, so let's
just pull the trigger.
2012-06-07 14:28:21 +02:00
Bobby Holley
a8f4d0e303 Bug 754202 - Pull object principals directly off the compartment, and assert that behavior doesn't change. r=bz 2012-06-07 14:28:21 +02:00
Boris Zbarsky
b4e6056558 Bug 761707 part 2. Drop the vestigial jsclass argument to UnwrapDOMObject. r=bholley 2012-06-06 15:59:46 -04:00
Gervase Markham
ca171eec44 Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Brian Hackett
c07eaa0e3e Use handles in API object hooks where possible, bug 750733. r=billm 2012-05-19 15:03:45 -07:00
Brian Hackett
9ae1966596 Backed out changeset 5fc7462dd394 for android orange. 2012-05-19 11:52:55 -07:00
Brian Hackett
a863456144 Use handles in API object hooks where possible, bug 750733. r=billm 2012-05-19 09:48:09 -07:00
Ms2ger
5623a92079 Bug 754968 - Part c: Make BindingUtils.h not require private xpconnect headers; r=bholley 2012-05-18 10:29:40 +02:00
Tom Schuster
fb630ae705 Bug 752226 - Remove any use of JSVAL_IS_OBJECT. r=luke,Ms2ger 2012-05-11 17:46:26 +02:00
Ed Morley
79899a6f75 Backout 9b0fcaacb788 & bf3fef257e68 (bug 752226) for mochitest-other orange 2012-05-11 18:25:52 +01:00
Tom Schuster
1941fb1bb4 Bug 752226 - Remove any use of JSVAL_IS_OBJECT. r=luke,Ms2ger
--HG--
extra : rebase_source : edf2077f8b8bad1970eab6ebe9996e761d4e596c
2012-05-11 17:46:26 +02:00
Ms2ger
3b04c7d79e Bug 741245 - Remove nsresult return value from nsXPConnect::GetSafeJSContext(); r=bholley 2012-05-05 11:00:05 +02:00
Boris Zbarsky
32c7f6e634 Bug 742217. Reduce the use of nested namespaces in our binding code. r=peterv,bent
In the new setup, all per-interface DOM binding files are exported into
mozilla/dom.  General files not specific to an interface are also exported into
mozilla/dom.

In terms of namespaces, most things now live in mozilla::dom.  Each interface
Foo that has generated code has a mozilla::dom::FooBinding namespace for said
generated code (and possibly a mozilla::bindings::FooBinding_workers if there's
separate codegen for workers).

IDL enums are a bit weird: since the name of the enum and the names of its
entries all end up in the same namespace, we still generate a C++ namespace
with the name of the IDL enum type with "Values" appended to it, with a
::valuelist inside for the actual C++ enum.  We then typedef
EnumFooValues::valuelist to EnumFoo.  That makes it a bit more difficult to
refer to the values, but means that values from different enums don't collide
with each other.

The enums with the proto and constructor IDs in them now live under the
mozilla::dom::prototypes and mozilla::dom::constructors namespaces respectively.
Again, this lets us deal sanely with the whole "enum value names are flattened
into the namespace the enum is in" deal.

The main benefit of this setup (and the reason "Binding" got appended to the
per-interface namespaces) is that this way "using mozilla::dom" should Just
Work for consumers and still allow C++ code to sanely use the IDL interface
names for concrete classes, which is fairly desirable.

--HG--
rename : dom/bindings/Utils.cpp => dom/bindings/BindingUtils.cpp
rename : dom/bindings/Utils.h => dom/bindings/BindingUtils.h
2012-05-03 00:35:38 -04:00
Bobby Holley
8bc0b852b9 Bug 750859 - Remove {Disable,Revert}Capability. r=bz, PGO helper on CLOSED TREE 2012-05-02 23:57:43 +02:00
Bobby Holley
37471e102e Bug 750859 - Remove (most of) SetCanEnableCapability. r=bz 2012-05-02 23:57:34 +02:00
Bobby Holley
61fa812956 Bug 750859 - Kill the CAPS confirm dialog. r=bz
This will break addons using enablePrivilege, but that's going away too. We've been warning for many releases now, so it's time to bite the bullet.
2012-05-02 23:57:34 +02:00
Bobby Holley
7901c91583 Bug 750859 - remove unused (or seldom-used) PrivilegeManager functions. r=bz 2012-05-02 23:57:34 +02:00
Gabor Krizsanits
4ab96d9a72 Bug 735280 - Part 3: Components object specific wrapper. r=bholley 2012-04-28 09:12:28 -04:00
Ryan VanderMeulen
3d3d4922c1 Backout a0b3af4ac9f5 (bug 735280) due to Android jsreftest orange. 2012-04-25 21:59:36 -04:00
Gabor Krizsanits
0f38ab4f31 Bug 735280 - Part 3: Components object specific wrapper. r=bholley 2012-04-25 20:12:33 -04:00
Ryan VanderMeulen
d485f6d4b3 Backout 0b170d1f5d10 (bug 735280) due to red. 2012-04-24 22:09:23 -04:00
Gabor Krizsanits
f58f1c2ecd Bug 735280 - Part 3: Components object specific wrapper. r=bholley 2012-04-24 21:48:02 -04:00
David Anderson
9e6c5a8a5f Remove simple JS_FrameIterator use from content, DOM, and caps (bug 744617, r=mrbkap).
--HG--
extra : rebase_source : 003a5285b549845d47c9298606d737620db5bb3d
2012-04-16 12:30:00 -07:00
Ms2ger
8299fe6b09 Backing out bf0a78471e5e:dc7022e2d807 for inexplicable windows crashes. 2012-04-14 17:52:34 +02:00
Ms2ger
f88fab52fb Bug 741245 - Remove nsresult return value from nsXPConnect::GetSafeJSContext(); r=bholley 2012-04-14 15:05:01 +02:00
Mark Capella
1a44f1208f Bug 740688 - Use uintptr_t instead of PRUword, and intptr_t instead of PRWord. r=jwalden
--HG--
extra : rebase_source : 648a581323d2c2893df780f71fe34dadcc4bbaab
2012-04-11 17:17:44 -07:00
Bobby Holley
5fdde2f486 Bug 739825 - Push principals when entering compartments in structured clone. r=mrbkap 2012-04-05 14:02:34 -07:00
Peter Van der Beken
c2e642fbcc Fix for bug 740069 (Generate JS bindings in C++ with a python script for DOM objects on the main thread and in workers. Infrastructure and new bindings for XMLHttpRequest). Patch by bent/bz/bholley/jst/khuey/peterv, r=bent/bz/bholley/jlebar/khuey/peterv/sicking/smaug.
--HG--
rename : js/xpconnect/tests/mochitest/test_bug462428.html => dom/bindings/test/test_lookupGetter.html
2012-03-30 21:42:20 -07:00
Igor Bukanov
7296e0408c bug 737624 - memory-only encoding/decoding of scripts and functions. r=:luke
The patch shrinks the API presented in jsxdrapi.h down to 4 functions to
encode/decode scripts and interpreted functions to/from the memory. The
newly introduced implementation header vm/Xdr.h replaces the former
JSXDRState with the template class XDRState parametrized by the enum
type with two constants, XDR_ENCODE and XDR_DECODE. This way a compiler
can fully eliminate the former runtime checks for the decoding/encoding
mode. As a drawback this required to explicitly instantiate the xdr
implementation as I do not want to put all the xdr code to header files.

The memory-only XDR allows to avoid coping filename and to-be-atomized
chars to a temporary buffer as the code can just access the buffer
directly. Another change is that new XDRScript takes as a parameter its
parent script. This allowed to avoid keeping filename in XDRState and
simplify the filename management.

Another change is the removal of JS_HAS_HDR. As CloneScript uses XDR to
copy a script, JS_HAS_XDR cannot be disabled.

--HG--
rename : js/src/jsxdrapi.cpp => js/src/vm/Xdr.cpp
extra : rebase_source : f8f1536a86b7c3fe7296a16b6677bd21664af98a
2012-02-20 11:58:00 +01:00
Dão Gottwald
766a2b3244 Backed out changeset 30798fdc5bad 2012-03-24 12:33:30 +01:00
Igor Bukanov
f8a4496d31 bug 737624 - memory-only encoding/decoding of scripts and functions. r=:luke
The patch shrinks the API presented in jsxdrapi.h down to 4 functions to
encode/decode scripts and interpreted functions to/from the memory. The
newly introduced implementation header vm/Xdr.h replaces the former
JSXDRState with the template class XDRState parametrized by the enum
type with two constants, XDR_ENCODE and XDR_DECODE. This way a compiler
can fully eliminate the former runtime checks for the decoding/encoding
mode. As a drawback this required to explicitly instantiate the xdr
implementation as I do not want to put all the xdr code to header files.

The memory-only XDR allows to avoid coping filename and to-be-atomized
chars to a temporary buffer as the code can just access the buffer
directly. Another change is that new XDRScript takes as a parameter its
parent script. This allowed to avoid keeping filename in XDRState and
simplify the filename management.

Another change is the removal of JS_HAS_HDR. As CloneScript uses XDR to
copy a script, JS_HAS_XDR cannot be disabled.

--HG--
rename : js/src/jsxdrapi.cpp => js/src/vm/Xdr.cpp
2012-02-20 11:58:00 +01:00
Ms2ger
8775c56114 Backed out changeset f33e1e959036; r=bustage 2012-03-24 11:04:34 +01:00
Igor Bukanov
8e97874303 bug 737624 - memory-only encoding/decoding of scripts and functions. r=:luke
The patch shrinks the API presented in jsxdrapi.h down to 4 functions to
encode/decode scripts and interpreted functions to/from the memory. The
newly introduced implementation header vm/Xdr.h replaces the former
JSXDRState with the template class XDRState parametrized by the enum
type with two constants, XDR_ENCODE and XDR_DECODE. This way a compiler
can fully eliminate the former runtime checks for the decoding/encoding
mode. As a drawback this required to explicitly instantiate the xdr
implementation as I do not want to put all the xdr code to header files.

The memory-only XDR allows to avoid coping filename and to-be-atomized
chars to a temporary buffer as the code can just access the buffer
directly. Another change is that new XDRScript takes as a parameter its
parent script. This allowed to avoid keeping filename in XDRState and
simplify the filename management.

Another change is the removal of JS_HAS_HDR. As CloneScript uses XDR to
copy a script, JS_HAS_XDR cannot be disabled.

--HG--
rename : js/src/jsxdrapi.cpp => js/src/vm/Xdr.cpp
2012-02-20 11:58:00 +01:00
Igor Bukanov
fbeb82e29f bug 730221 - delegating serialization of script principals to the embedding. r=:luke,:bz
Currently to serialize principals stored in JSScript we have a rather complex
schema. First there is the transcode callback that the embedding must provide
to transcode principals using XDR API. Second we use rather complex glue code
to implement that callback in terms of writing/reading nsIObjectOutputStream/
nsIObjectInputStream. This glue code is duplicated in 3 places. All this can
be avoided if we simply delegate transcoding of principals to the caller. In
addition, at least in the case of the cached startup scripts we do not even
need to transcode the principals as the the cached scripts always have the
system principal so we can skip all the transcode complexity there.

The patch implemnts this idea. In particular, the code in JS engine
responsible for transcoding of principals is replaced by the single API
function JS_XDRSetPrincipals that the embedding can use to set principals for
decoded scripts and functions. Then the startup cache uses this to set the
principals for the decoded script to the system principals. The other two
places in nsJSContext::Serialize and  XBL_SerializeFunction that need to
serialize principals together with a function or script now uses common
utilities in nsXPConnect so the serialization complexity resides in the single
 place.
2012-02-13 14:10:04 +01:00
Gavin Sharp
dbd20f7833 Bug 732413: make DISALLOW_INHERIT_PRINCIPAL flag passed to checkLoadURI effective even when the source principal is the system principal, r=bz
--HG--
rename : caps/tests/mochitest/test_bug470804.html => caps/tests/mochitest/test_disallowInheritPrincipal.html
extra : transplant_source : %CD%A3%DD%8Aa%DC%1F%BE%F8%0DB%BE%86%3FQ%D8%95%88%9E%CA
2012-03-14 11:55:47 -07:00
Bobby Holley
c9729c8e9a Bug 735544 - Allow exception stacks to cross compartment boundaries. r=luke 2012-03-15 15:19:52 -07:00
Justin Lebar
0dbaf73150 Bug 729940 - Part 2: Stop using crappy hash functions in Gecko. r=bz
--HG--
extra : rebase_source : 6fa267a89878cc1a766d8618569debcea9b12e48
2012-03-12 18:53:18 -04:00