Commit Graph

558 Commits

Author SHA1 Message Date
Jonas Sicking
4c50ad8340 Bug 774585: Remove unused argument in nsScriptSecurityManager. r=mrbkap 2012-07-17 22:28:47 -07:00
Makoto Kato
1e533fbd2e Bug 769533 - Part 1. Replace AppendWithConversion with others. r=jlebar 2012-07-06 18:43:28 +09:00
Bobby Holley
791b8a0a39 Bug 754202 - Check principal in IsCapabilityEnabled when there's no code on the stack. r=mrbkap 2012-06-28 23:47:55 +02:00
Bobby Holley
338e1a2a10 Bug 754202 - Remove mContextPrincipal usage from within nsScriptSecurityManager. r=mrbkap 2012-06-28 23:47:55 +02:00
Bobby Holley
83245872f0 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-28 23:47:55 +02:00
Bobby Holley
285b2d0a7e 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-28 23:47:55 +02:00
Bobby Holley
6def798e8f Bug 754202 - Pull object principals directly off the compartment and assert that behavior doesn't change. r=bz 2012-06-28 23:47:55 +02:00
Justin Lebar
0ba5460898 Bug 766173 - Hold a strong ref to nsScriptSecurityManager, instead of hoping that it won't get addref'ed or released. r=bsmedberg
--HG--
rename : mobile/android/base/resources/drawable/tabs_button_contracted.xml => mobile/android/base/resources/drawable/tabs_button.xml
extra : rebase_source : 8f861c2298fd053a0e1f6deb6f9945040ea8db90
2012-06-19 13:20:34 -04:00
L. David Baron
ca009b979f Backout bug 754202 (all patches, rather than just patches 3-7). 2012-06-10 17:22:31 -07:00
Ryan VanderMeulen
0ec5784959 Backout 90107a2a0c64 (bug 754202) for real due to orange. 2012-06-10 19:46:20 -04:00
Ryan VanderMeulen
5f2a19ee6e Revert c39d36167b99 due to a horribly munged backout. 2012-06-10 19:44:50 -04:00
Ryan VanderMeulen
6d6c4efbab Backout the bug 754202 backout due to orange. 2012-06-10 19:37:47 -04:00
Bobby Holley
75ea89c874 Merge backout. 2012-06-11 00:28:30 +02:00
Bobby Holley
b65e3d0fc1 Back out bug 754202. r=me 2012-06-11 00:28:05 +02:00
Gabor Krizsanits
a4d0a2ae65 Bug 734891 - part 2: Adding ExpandedPrincipal support 2012-06-09 15:19:26 -07:00
Bobby Holley
8c6bec7d49 Bug 754202 - Remove mContextPrincipal usage from within nsScriptSecurityManager. r=mrbkap 2012-06-07 14:28:22 +02:00
Bobby Holley
3065c84571 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
3d5afc4e42 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
ddbdb6b79b 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
809a53856c Bug 761707 part 2. Drop the vestigial jsclass argument to UnwrapDOMObject. r=bholley 2012-06-06 15:59:46 -04:00
Gervase Markham
82ff7027aa Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Brian Hackett
d55ff730fa Use handles in API object hooks where possible, bug 750733. r=billm 2012-05-19 15:03:45 -07:00
Brian Hackett
66d81d0a7e Backed out changeset 5fc7462dd394 for android orange. 2012-05-19 11:52:55 -07:00
Brian Hackett
7235558c07 Use handles in API object hooks where possible, bug 750733. r=billm 2012-05-19 09:48:09 -07:00
Ms2ger
ba51dd062a Bug 754968 - Part c: Make BindingUtils.h not require private xpconnect headers; r=bholley 2012-05-18 10:29:40 +02:00
Ms2ger
a147767a14 Bug 741245 - Remove nsresult return value from nsXPConnect::GetSafeJSContext(); r=bholley 2012-05-05 11:00:05 +02:00
Boris Zbarsky
2299a42041 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
710c5cfdb0 Bug 750859 - Remove {Disable,Revert}Capability. r=bz, PGO helper on CLOSED TREE 2012-05-02 23:57:43 +02:00
Bobby Holley
e6e34db54d Bug 750859 - Remove (most of) SetCanEnableCapability. r=bz 2012-05-02 23:57:34 +02:00
Bobby Holley
c532e2d4c3 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
David Anderson
94ccb204aa 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
77ca860259 Backing out bf0a78471e5e:dc7022e2d807 for inexplicable windows crashes. 2012-04-14 17:52:34 +02:00
Ms2ger
5a2d0a8476 Bug 741245 - Remove nsresult return value from nsXPConnect::GetSafeJSContext(); r=bholley 2012-04-14 15:05:01 +02:00
Mark Capella
bb0cb90d39 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
403f8c3812 Bug 739825 - Push principals when entering compartments in structured clone. r=mrbkap 2012-04-05 14:02:34 -07:00
Peter Van der Beken
ed510d3506 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
c8154dcd0e 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
0dfb017329 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
Igor Bukanov
524dbd7e47 bug 728250 - remove JSPrincipals::codebase. r=:luke,:bz
In just 2 cases where JSPrincipals::codebase is used it can be reconstructed from the values stored in the associated nsJSPrincipal. In addition the patch makes nsJSprincipals to inherit both from nsIPrincipal and JSPrincipals allowing to use static_cast to convert between nsIPrincipal and JSPrincipals pointers and to drop many cases of manual JSPrincipal reference counting.
2012-03-09 10:48:50 +01:00
Bobby Holley
6edd485a24 Bug 700561 - Relax short-circuit principal checks on account of inner window reuse. r=bz 2012-02-18 08:55:28 -08:00
Terrence Cole
aed2094b1c Bug 787580 - Root all jsval at the API surface; r=sfink sr=dmandelin
--HG--
rename : layout/reftests/text-decoration/underline-select-2-ref.html => layout/reftests/text-decoration/underline-button-1-ref.html
rename : layout/reftests/text-decoration/underline-select-2.html => layout/reftests/text-decoration/underline-button-1.html
extra : rebase_source : 008f2bab76a005947a4c0bd10b6d9ea8531ea6d0
2012-09-04 16:40:12 -07:00
Bobby Holley
f56195c7a3 Bug 713747 - Remove UniversalFoo from caps (and thus, the tree). r=bz 2011-12-30 09:35:52 -08:00
Brian Hackett
fe910ee8ec Add JSScript::function, bug 693754. 2011-10-21 14:31:01 -07:00
Brian Hackett
4eb699754e Merge MC -> JM
--HG--
rename : js/src/jsparse.cpp => js/src/frontend/BytecodeCompiler.cpp
rename : js/src/jsparse.h => js/src/frontend/BytecodeCompiler.h
rename : js/src/jsemit.cpp => js/src/frontend/BytecodeGenerator.cpp
rename : js/src/jsemit.h => js/src/frontend/BytecodeGenerator.h
rename : js/src/jsparse.cpp => js/src/frontend/FoldConstants.cpp
rename : js/src/jsparse.cpp => js/src/frontend/ParseNode.cpp
rename : js/src/jsparse.h => js/src/frontend/ParseNode.h
rename : js/src/jsparse.cpp => js/src/frontend/Parser.cpp
rename : js/src/jsparse.h => js/src/frontend/Parser.h
rename : js/src/jsregexpinlines.h => js/src/vm/RegExpObject-inl.h
rename : js/src/jsregexp.cpp => js/src/vm/RegExpObject.cpp
rename : js/src/jsregexp.h => js/src/vm/RegExpObject.h
rename : js/src/xpconnect/src/xpcjsruntime.cpp => js/xpconnect/src/XPCJSRuntime.cpp
rename : js/src/xpconnect/src/xpcquickstubs.cpp => js/xpconnect/src/XPCQuickStubs.cpp
rename : js/src/xpconnect/src/nsXPConnect.cpp => js/xpconnect/src/nsXPConnect.cpp
2011-10-19 14:26:08 -07:00
Ehsan Akhgari
92064e6d3f Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Landing on a CLOSED TREE
2011-10-17 10:59:28 -04:00
Brian Hackett
1ca40e7627 Move scope chains of scope objects to reserved slots, bug 694247. 2011-10-12 22:29:43 -07:00
Brian Hackett
c35c29c1a0 Fix test failures, bug 693754. 2011-10-12 08:32:42 -07:00
Brian Hackett
c632b70b2b Remove jsobj.h from installed headers, bug 690943. r=luke 2011-10-04 07:06:54 -07:00
Jeff Walden
b5e57820bf Bug 693469 - Implement mozilla::ArrayLength and mozilla::ArrayEnd, and replace uses of NS_ARRAY_LENGTH whenever possible. (Exceptions: assigning to static initializers, use in static assertions, as template parameters, etc. These will go away when the relevant compilers have C++11 constexpr support.) r=cjones
--HG--
extra : rebase_source : b4bae9a0f85abf2feb828609b50e756916b99a6f
2011-10-10 22:50:08 -07:00
Jeff Walden
d0532c3e95 Back out everything since 5435ee09cf7b. Tinderbox compilers hate me. r=epic-fail 2011-10-12 12:21:53 -07:00
Jeff Walden
0f30b277bf Bug 639469 - Implement mozilla::ArrayLength and mozilla::ArrayEnd, and replace uses of NS_ARRAY_LENGTH whenever possible. r=cjones
--HG--
extra : rebase_source : 860a8271bf7e51cde358f2a4185c410de1fc2960
2011-10-10 22:50:08 -07:00
Michael Wu
d2b70213ac Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
--HG--
rename : tools/trace-malloc/bloatblame.c => tools/trace-malloc/bloatblame.cpp
2011-09-28 23:19:26 -07:00
Wolfgang Germund
80c37cdd5a Bug 296795: ZipReader doesn't handle non-ASCII characters r=taras 2011-09-28 16:14:45 -07:00
Chris Leary
3b3f1cf4c7 Bug 684039: rewrite JS LIFO allocator, avoids thrashing. (r=luke)
--HG--
rename : js/src/jsarena.h => js/src/ds/LifoAlloc.h
extra : rebase_source : 098bf9561114f82363ebd0862213acf952709257
2011-09-22 13:22:30 -07:00
Luke Wagner
293c7bcf13 Bug 684110 - Clean JSObject::clasp usage (r=pbiggar) 2011-09-02 17:23:26 -07:00
Ed Morley
5ad1e0be99 Backout bug 684110 (08b6eaf6aad0, cf8b35fa1010, 25ee45edabe1, 659f5c7d2cc9, 870f6dd82586 & e1ad65d6a7fd) and bug 684344 (cd1957f6628d) on a CLOSED TREE; a=bustage-fairies 2011-09-03 03:21:25 +01:00
Luke Wagner
bddd0c80c3 Bug 684110 - Clean JSObject::clasp usage (r=pbiggar) 2011-09-02 17:23:26 -07:00
Jason Orendorff
ae0a46f6d1 Bug 679879 - Change JSFunction macros to methods. Part 1, remove the macro uses from caps. r=mrbkap. 2011-08-18 12:34:20 -05:00
Blake Kaplan
bcbd536c82 Fix bug 674182. r=jst 2011-07-27 12:29:26 -07:00
Luke Wagner
8d479a53ec Backout out bug 672026 for causing mobile startup crashes 2011-07-21 16:39:10 -07:00
arno renevier
8ed39834bd Bug 669299 - Remove unneeded nsPrintfCString.h includes. r=bsmedberg 2011-07-21 04:37:31 +02:00
Luke Wagner
5d68ed0dbd Bug 672026 - Ensure that there is an object principals finder during early startup (r=mrbkap) 2011-07-18 17:37:19 -07:00
Ms2ger
8c78d3f478 Bug 670235 - Remove nsIDOMWindowInternal; r=sicking 2011-07-15 12:31:34 +02:00
Luke Wagner
dd8cec0710 Bug 667915 - Don't let content JS consume all the stack and cause chrome JS to OOM (r=waldo,mrbkap) 2011-06-30 09:26:56 -07:00
Matheus Kerschbaum
27331333ef Bug 662000 part 2: Remove XPC_IDISPATCH_SUPPORT from the build-system and XPConnect. r=mrbkap
--HG--
extra : rebase_source : c456802fe36eef1e49381be996dbbdf820781206
2011-06-22 11:56:47 -04:00
Masayuki Nakano
eafdcc3af5 Bug 660770 caps should use mozilla::Preferences r=roc+jst 2011-06-20 12:00:16 +09:00
Jonathan Protzenko
e6410e5f11 Bug 662126 - Audit ConfirmEx callers to ensure that aCheckState is not an uninitialized PRBool r=bz 2011-06-07 20:06:12 +02:00
Chris Leary
3400d7a2e7 Merge mozilla-central and tracemonkey. 2011-05-20 14:29:36 -07:00
Chris Leary
4fef967f20 Bug 654301: Better interned string API, take 2. (r=Waldo) 2011-05-17 12:15:12 -07:00
Josh Aas
669eb04ac7 Bug 637253: Remove nsIPluginInstance interface. r=bsmedberg 2011-05-17 21:48:34 -04:00
Jason Orendorff
c0b826d646 Bug 645160 - jsdIStackFrame is incorrectly truncated at indirect eval calls. r=mrbkap. 2011-05-11 11:11:40 -05:00
Chris Leary
0e34a9857c Back out bug 654301 to run again on try. 2011-05-16 19:03:20 -07:00
Chris Leary
36481bff9a Bug 654301: Better interned string API. (r=Waldo) 2011-05-16 18:18:59 -07:00
Brandon Sterne
69a9afc059 Bug 600584 - add more detail to CSP violation report logging, r=jst, a=LegNeato 2011-01-31 10:09:44 -08:00
Blake Kaplan
fbfc5f0ad6 Fix bug 614151. r=jst@mozilla.com, a=blocker 2010-12-28 11:21:30 -08:00
Chris Leary
cba55906d2 Merge mozilla-central into tracemonkey. 2011-01-04 10:51:14 -08:00
Chris Jones
210c54df22 Bug 616412: Fix use-before-init bug. r=mrbkap a=a 2011-01-04 10:40:54 -06:00
Chris Leary
b83b3feb7f Merge mozilla-central to tracemonkey. 2010-12-29 19:25:04 -05:00
Boris Zbarsky
8534ad52e2 Bug 549459. Don't show information about the object principal in the error string. r=mrbkap a=blocker 2010-12-22 19:55:42 -05:00
Luke Wagner
56b2810a26 Bug 609440, part 3 - remove fallible public APIs, update mozilla (r=bent,jst,mrbkap,waldo,sdwilsh) 2010-12-03 00:24:17 -08:00
Peter Van der Beken
a6974efb9d Fix for bug 590612 (Speed up js-wrapping in classinfo when we already have a wrapper). r=bz, a=jst. 2010-08-28 10:04:25 +02:00
Peter Van der Beken
e036314b75 Bug 580128 - Always wrap Location objects in wrappers, even for same origin. r=mrbkap/gal 2010-09-29 10:00:52 -07:00
Bjarne
ed732b9f7f Bug 546606 - Make redirect API async - part 2; r=honzab.moz,cbiesinger,bjarne,jst sr=jst 2010-08-04 22:15:55 -04:00
Igor Bukanov
7ae0ecc9d3 bug 571789 - merging JSObjectOps and JSExtendedClass into JSClass. r=jorendorff 2010-06-12 18:29:04 +02:00
Igor Bukanov
9842e59608 Backed out changeset 7b2b90efe57d -- the patch was landed against a tree with a lot of orange. This will hinder the orange resolution. 2010-07-28 14:36:06 +02:00
Igor Bukanov
781e5c46d7 bug 571789 - merging JSObjectOps and JSExtendedClass into JSClass. r=jorendorff 2010-06-12 18:29:04 +02:00
Luke Wagner
7371ad00ed Bug 549143 - fatvals 2010-07-14 23:19:36 -07:00
Ehsan Akhgari
3e874ca35e Bug 519928 - IFRAME inside designMode disables JavaScript, breaking current clickjacking defenses; r=Olli.Pettay
--HG--
extra : rebase_source : 7d01d90f59e60b63e64b96bb655937fe0d0c879a
2010-06-04 17:03:50 -04:00
Ehsan Akhgari
c06468921a Backed out changeset d1cbe16de6bf to fix oranges 2010-06-28 15:29:30 -04:00
Ehsan Akhgari
741c672888 Bug 519928 - IFRAME inside designMode disables JavaScript, breaking current clickjacking defenses; r=Olli.Pettay 2010-06-04 17:03:50 -04:00
Dan Witte
7c610ca8ac Bug 564048 - Nix security checks in nsPrefBranch. r=sicking, sr=jst 2010-06-08 16:43:54 -07:00
Olli Pettay
927111fb28 Bug 549682 - Port the message-manager API to mozilla-central, r=jst 2010-05-18 15:28:37 +03:00
Olli Pettay
1c104f5606 Backout Bug 549682 2010-05-18 13:10:47 +03:00
Olli Pettay
c719bc6e84 Bug 549682 - Port the message-manager API to mozilla-central, r=jst
--HG--
extra : rebase_source : 45b28a7762428193873a636fa7d5108607f9e4a3
2010-05-18 11:52:24 +03:00
Mitchell Field
0fd15d94da Bug 564950 - Make more use of mozilla::services, r=surkov, jst, neil, smontagu, roc, joshmoz, gavin, shaver 2010-05-14 18:24:41 +09:00
Peter Van der Beken
df91a46a76 Fix for bug 560199 (Link XPConnect and caps into layout). r=jst.
--HG--
extra : rebase_source : 5141822e9d560019ffc1e0cb0264782aa8aa7a99
2010-04-11 15:55:24 +02:00
Robert Sayre
66f3f0f7a3 Merge tracemonkey to mozilla-central. 2010-03-26 15:53:14 -07:00
Igor Bukanov
382035ba66 bug 549010 - folowup to replace PROTO access macros with the inlne function 2010-03-04 23:52:52 -08:00
Jonas Sicking
893023f46a Bug 543696: Remove unused nsIScriptSecurityManager::CheckConnect. r/sr=mrbkap 2010-02-02 02:29:15 -08:00
Blake Kaplan
9c71e872ce Bug 371694 - Protect ourselves against null values. r=dveditz 2010-03-22 15:50:04 -07:00