Граф коммитов

64 Коммитов

Автор SHA1 Сообщение Дата
Boris Zbarsky f110e1483e 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
Mark Capella fd7631eab2 Bug 723530 - double error reporting in ctype JS api implementation, r=bholley 2012-04-27 12:47:00 +02:00
Gabor Krizsanits f3b232d770 Bug 735280 - Part 3: Components object specific wrapper. r=bholley 2012-04-28 09:12:28 -04:00
Eddy Bruel 956914dcf6 Bug 703537: Removing the fix trap r=jorendorff@mozilla.com 2012-04-27 17:09:32 -04:00
Ryan VanderMeulen e580e20775 Backout a0b3af4ac9f5 (bug 735280) due to Android jsreftest orange. 2012-04-25 21:59:36 -04:00
Gabor Krizsanits 5c2e5e5fc5 Bug 735280 - Part 3: Components object specific wrapper. r=bholley 2012-04-25 20:12:33 -04:00
Ryan VanderMeulen 5ad12c22c7 Backout 0b170d1f5d10 (bug 735280) due to red. 2012-04-24 22:09:23 -04:00
Gabor Krizsanits 656e5edc68 Bug 735280 - Part 3: Components object specific wrapper. r=bholley 2012-04-24 21:48:02 -04:00
Boris Zbarsky 3b171066b1 Bug 726949. Instead of using the given proto for the sandbox directly, use a proxy that forwards to the given proto but rebinds all getters/setters/methods to use the given proto, not the sandbox global, as this. r=bholley, a=tracking-firefox
The code in XPCQuickStubs.h just moved from XPCQuickStubs.cpp.
2012-04-19 14:19:41 -04:00
David Anderson 38a1b3238e Remove more uses of JS_FrameIterator (bug 744617, r=mrbkap). 2012-04-16 12:30:04 -07:00
David Anderson 8313be1cdc Remove simple JS_FrameIterator uses in xpconnect (bug 744617, r=bholley).
--HG--
extra : rebase_source : c206450cf46011543f58cded4c5aff2d49932afd
2012-04-16 12:25:28 -07:00
Gabor Krizsanits f6cf2a8310 Bug 733035 - postMessage support for sandboxes. r=khuey 2012-04-05 18:33:20 -04:00
Bobby Holley a87e554836 Bug 739796 - Make same-origin cross-compartment Location object access go through the LW in the host compartment. r=gal
--HG--
extra : rebase_source : d5e07d4628bfd5990d127b4316219a43c4e0de88
2012-04-05 12:21:12 -07:00
Peter Van der Beken a739a7d072 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
Peter Van der Beken 4331998be9 Fix for bug 740064 (Refactor XrayWrapper). r=bholley.
--HG--
extra : rebase_source : 60559d74b10761a794d83a0a63dc60a92b2d48eb
2012-03-27 16:31:37 -07:00
Luke Wagner 1bfb59be0a Bug 733793 - Check for null return from JS_ObjectToOuterObject (r=bholley)
--HG--
extra : rebase_source : 2b7fbb3a72f641785de7f7707e9b6e8013b4eb6d
2012-03-28 16:15:38 -07:00
Bobby Holley e259bcdfe4 Bug 738874 - Don't allow non-classinfo XPCWNs to be wrapped cross-compartment. r=mrbkap 2012-03-25 22:35:50 -07:00
Bobby Holley 6e5e5a0e1c Bug 733984 - Explicitly disallow shadowing on location wrappers. r=mrbkap
This was taken care of in other ways before, but we need to be more explicit about it now that we're doing more Xray stuff with Location wrappers.
2012-03-23 15:58:18 -07:00
Bobby Holley c97cc8f97e Bug 667388 - Introduce the PUNCTURE wrapper action. r=mrbkap 2012-03-23 14:59:27 -07:00
Bobby Holley 2cc026f2cd Bug 667388 - Make the chrome-to-content Xray wrapper derive CrossCompartmentWrapper. r=mrbkap
The current situation seems incorrect, especially given the behavior of CrossOriginWrapper and XrayProxy. Currently it doesn't matter, but it probably will in the future.
2012-03-23 14:59:27 -07:00
Bobby Holley e3ae6aa656 Bug 733984 - Apply Location wrappers for same-origin cross-compartment wrapping. r=mrbkap
This isn't an issue right now, since it can't ever happen outside of sandboxes, which content can't use. But if it could, it could get a pure CrossCompartmentWrapper to a Location object, which is bad.
2012-03-23 14:59:23 -07:00
Bobby Holley b63aa855aa Bug 733984 - Use the Location security policy even for content accessing chrome. r=mrbkap
I'm adding asserts about when we do and don't have a Location object behind the wrapper, and this case was hitting them. What we do here doesn't so much matter given how this stuff all works. On the one hand, statically using a restrictive policy is slightly more defense-in-depth. On the other hand, if this stuff is broken we're screwed in much more serious ways than content reading chrome locations, and using a consistent wrapper scheme allows us to make stronger asserts and assumptions.

I opted for stronger assumptions and more understandable security code. If Blake feels strongly though, I could go the other way and sprinkle '|| isChrome(obj)' throughout the asserts though.
2012-03-23 14:59:19 -07:00
Bobby Holley 31bc8592bd Bug 733984 - Clarify the security characteristics of Location objects. r=mrbkap
I was getting confused by some of the naming and lack of comments here.
2012-03-23 14:59:07 -07:00
Bobby Holley ad7f0d278c Bug 733984 - Stop specializing createHolder, and simplify holder creation in WrapperFactory::Rewrap. r=mrbkap 2012-03-23 14:59:04 -07:00
Igor Bukanov 9de7e8c133 bug 736978 - remove JS_FinalizeStub. r=:billm
Currently the GC finalizes on the background thread only objects with null
JSClass::finalize. However, this implies that any object that uses
JS_FinalizeStub for the finalizer would be prevented from the background
finalization.

To fix this the patch removes JS_FinalizeStub replacing it with NULL in all
cases when the class has no custom finalizer. For style consistency the patch
also removed the usage of JSCLASS_NO_OPTIONAL_MEMBERS in the static
declarations as the compiler fills the missing fields with null in any cases.
2012-03-19 15:27:58 +01:00
Bobby Holley d70f3af183 Bug 734475 - Take the full union of native sets when bringing non-PreCreate XPWNs across compartments. r=mrbkap 2012-03-16 12:47:20 -07:00
Igor Bukanov 9ec52439ab 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
Igor Bukanov 6d4820f954 bug 730281 - remove cx argument from GC and compartment related functions. r=:billm 2012-02-29 13:18:16 +01:00
David Mandelin c5d656dd4f Bug 730511: remove obsolete typedefs intN, uintN, r=luke 2012-02-28 15:11:11 -08:00
Daniel Holbert a6065e5866 Bug 730074: Use JSCLASS_NO_OPTIONAL_MEMBERS in JSClass definition within XrayWrapper.cpp, to fix build warning about missing braces. r=mrbkap 2012-02-24 14:31:49 +01:00
Bill McCloskey c9f1b501e7 Bug 716067 - UnmarkGray more often (r=bent) 2012-02-10 18:32:13 -08:00
Phil Ringnalda 79dd21efd8 Back out 5f623a11c6cb (bug 713226), 1ed8ccf96402 (bug 721579), 32af27f89c49 (bug 722028), 1300d282fd22 (bug 716067), dc0f6ad7eff3 (bug 723313), 0d2ab3f2e9b9 (bug 723773) for talos crashes 2012-02-10 19:47:48 -08:00
Bill McCloskey a0c55b81e3 Bug 716067 - UnmarkGray more often (r=bent) 2012-02-10 18:32:13 -08:00
Igor Bukanov 8c6f4e7fc1 bug 724310 - drop cx argument from JSObject field and fixed slots infallible API. r=:Waldo
--HG--
extra : rebase_source : b78519db2ff008eb5143676d2db47935f0e89f45
2012-02-05 21:07:23 +01:00
Igor Bukanov 79f7fd1c2c backout merge for bug 724310. r=irc 2012-02-09 21:28:22 +01:00
Igor Bukanov af0ed045b3 bug 723517 - drop cx argument from JSObject field and fixed slots infallible API. r=:Waldo
--HG--
extra : rebase_source : c461dfc0e0e0462ab262cc01c2a771d3bb0971cc
2012-02-05 21:07:23 +01:00
Igor Bukanov 0497221a55 bug 723517 - Drop cx argumrent from JS_GetClass(cx, obj). r=luke 2012-02-04 01:54:57 +01:00
Blake Kaplan dca1f84b06 Bug 723111 - Add an option to js::UnwrapObject so that it doesn't stop at outer windows when unwrapping. This is useful for cases where we are trying to find the wrapped native for a security wrapper. r=bzbarsky 2012-01-26 14:55:27 +01:00
Phil Ringnalda 9e8cb1bc77 Back out 9aac714775b9 (bug 723111) for make check orange 2012-02-01 10:25:04 -08:00
Blake Kaplan 4f174bb5bb Bug 723111 - Add an option to js::UnwrapObject so that it doesn't stop at outer windows when unwrapping. This is useful for cases where we are trying to find the wrapped native for a security wrapper. r=bzbarsky
--HG--
extra : rebase_source : 51216cf21b63554e50633c89f393c5888241dee2
2012-01-26 14:55:27 +01:00
Ms2ger 03b8383404 Bug 677079 - Part y: Move AutoIdVector to jsapi.h; r=evilpie 2012-01-15 09:13:11 +01:00
Ms2ger a26231cf02 Bug 677079 - Part m: Expose context's compartment in jsfriendapi.h; r=jorendorff 2012-01-15 09:13:09 +01:00
Ms2ger 24017bc1c5 Bug 677079 - Part b: Use existing JSAPI functions where those are available; r=bholley 2012-01-15 09:13:07 +01:00
Ms2ger 237c96caad Bug 716357 - Fix license header in FilteringWrapper.cpp; r=gerv DONTBUILD 2012-01-11 17:12:21 +01:00
Ms2ger 8e10383f13 Bug 714458 - Part c: Don't include jscntxt.h in xpcprivate.h; r=bholley
This removes the inclusion from xpcprivate.h, and adds the include to XPConnect
files that still need it, along with notes to clarify what these files need
from the include. These notes will be removed while fixing bug 677079.
2012-01-11 09:23:08 +01:00
Ms2ger 8a0d13f695 Bug 714057 - Remove uintn users from XPConnect; r=bholley+khuey 2012-01-02 19:05:19 +01:00
Ms2ger 1b51b61950 Bug 711859 - Add an IsObjectInContextCompartment API; seems-better-than-the-alternative-all-things-considered=Waldo 2011-12-24 09:28:55 +01:00
Jeff Walden 8e960d2a6d Add MOZ_OVERRIDE to CrossOriginWrapper functions. No bug (but sort of r=luke from bug 708735 :-) )
--HG--
extra : rebase_source : d0bdbc8c031457a3a9f7f8cc82d141e0d83883f4
2011-12-15 14:32:25 -05:00
Bobby Holley 53c5cc2bb5 Bug 706301 - Don't cache own properties on XrayProxy. r=mrbkap 2011-12-06 11:05:26 -08:00
Brian Hackett a476b0c45a Merge MC -> JM 2011-12-03 10:34:26 -08:00