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

284 Коммитов

Автор SHA1 Сообщение Дата
Boris Zbarsky f490c53f7d Bug 815803. Now that JSSLOT_PROXY_PRIVATE == 0, simplify binding code that had to deal with different slot indices on proxy and non-proxy objects. r=peterv 2012-12-06 15:21:19 -05:00
Peter Van der Beken 41a9701717 Fix for bug 814821 (Dromaeo dom-traverse regression from bug 812333) - part 4: inline xpc_qsUnwrapObj. r=bz.
--HG--
extra : rebase_source : 712ff5573098f9d29fce555fb8cd548c5900d60e
2012-11-27 10:20:05 +01:00
Peter Van der Beken a40774deb2 Fix for bug 814821 (Dromaeo dom-traverse regression from bug 812333) - part 2: make WrapNewBindingObject a little faster. r=bz.
--HG--
extra : rebase_source : ea52aea5d91436b516c8aa439f4af741cdea824c
2012-11-27 10:20:04 +01:00
Peter Van der Beken 7a757eb82e Fix for bug 814821 (Dromaeo dom-traverse regression from bug 812333) - part 1: use qsObjectHelper instead of xpcObjectHelper in HandleNewBindingWrappingFailure. r=bz.
--HG--
extra : rebase_source : 32e20aec9cf2ea8a6e8d878ce758f792e6b8a67f
2012-11-27 10:20:04 +01:00
Ehsan Akhgari d6d6c3d26a Backed out 6 changesets (bug 814821, bug 815158, bug 814195) for test failures
Backed out changeset 0c2011091748 (bug 815158)
Backed out changeset 9d70b4460508 (bug 814195)
Backed out changeset bf8746658a72 (bug 814821)
Backed out changeset e73366b088d7 (bug 814821)
Backed out changeset 49fc6d535c41 (bug 814821)
Backed out changeset 987aea26a43a (bug 814821)
2012-11-27 16:30:39 -05:00
Peter Van der Beken bbe8e49a7f Fix for bug 814821 (Dromaeo dom-traverse regression from bug 812333) - part 4: inline xpc_qsUnwrapObj. r=bz.
--HG--
extra : rebase_source : 8506cc86db7ebfe8832ed5696aeb45c79364af1f
2012-11-27 10:20:05 +01:00
Peter Van der Beken f805d53dbb Fix for bug 814821 (Dromaeo dom-traverse regression from bug 812333) - part 2: make WrapNewBindingObject a little faster. r=bz.
--HG--
extra : rebase_source : 81a3891d0f51d98f4230583f816a82906d0ee904
2012-11-27 10:20:04 +01:00
Peter Van der Beken 6e634d59b7 Fix for bug 814821 (Dromaeo dom-traverse regression from bug 812333) - part 1: use qsObjectHelper instead of xpcObjectHelper in HandleNewBindingWrappingFailure. r=bz.
--HG--
extra : rebase_source : 748e0343d37e2b9a25b5b6644bebff428474310c
2012-11-27 10:20:04 +01:00
Peter Van der Beken 47915af064 Fix for bug 812333 (Replace Node quickstubs with new binding methods) - part 2: install Node's binding methods on the XPConnect proto. r=bz. 2012-11-22 12:09:41 +01:00
Peter Van der Beken 3127552628 Fix for bug 812333 (Replace Node quickstubs with new binding methods) - part 1: make WrapNewBindingObject asserts deal with HTMLCollection. r=bz. 2012-11-22 11:46:53 +01:00
Boris Zbarsky b6b9137a48 Bug 813423. A bit more inlining for stuff that should really be inline. r=peterv 2012-11-20 11:36:06 -05:00
Boris Zbarsky 77eb8146ff Bug 813419. Add a non-null-checking version of xpc_UnmarkGrayObject. r=mccr8 2012-11-20 11:36:06 -05:00
Bobby Holley 7c36e30523 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
Peter Van der Beken b2ba5959ec Fix for bug 804950 (New DOM binding APIs for Element). r=bz.
--HG--
extra : rebase_source : a8691ead07dfa8ecca812396047627dc15474d83
2012-10-16 13:51:00 +02:00
Boris Zbarsky c366dccf9b Bug 805310. Add some documentation for our object-wrapping helpers. r=peterv 2012-11-09 08:24:32 -08:00
Boris Zbarsky 272331140d Bug 779048 part 8. Handling of arguments for callbacks. r=peterv
Note that we're now using the array object as the "obj" when wrapping
sequence members, because we don't have an 'obj' around in our
code... and every single existing sequence-of-interfaces consumer
relied on there being an 'obj' floating about.

Also note that I needed to rearrange the various wrapping helpers so
that we can wrap things that are hanging out in const smartpointers or
in const OwningNonNull or in plain object references.
2012-11-09 07:43:58 -08:00
Boris Zbarsky 1649f6c386 Bug 779048 part 6. Handling of return values for callbacks. r=peterv 2012-11-09 07:43:58 -08:00
Boris Zbarsky 7752f218bb Bug 779048 part 4. Implement basic codegen for callbacks, without handling of arguments or return values yet. r=peterv 2012-11-09 07:43:57 -08:00
Boris Zbarsky 97b83582f6 Bug 805988. Add some asserts that new-binding objects are nsISupports if they claim to be or or can be safely reinterpret_cast to nsWrapperCache, if they have an nsWrapperCache at all, if they don't claim to be nsISupports. r=peterv
Note that everything except the new asserts just got moved with no changes.
2012-11-08 23:48:42 -08:00
Masatoshi Kimura 5e13172aad Bug 801487 - Implement ErrorResult::ThrowTypeError. r=bz 2012-11-06 18:23:14 -05:00
Boris Zbarsky d1b570c89c 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
Peter Van der Beken 669602b5e0 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
Peter Van der Beken 2f66678f37 Fix for bug 778152 (Content window does not have an XMLHttpRequest property when accessed via an Xray wrapper in a subscript) - move some code. r=bz.
--HG--
extra : rebase_source : 524e537ee6c6b30fdb67cbced3dbb574de83be28
2012-10-09 20:50:27 +02:00
Peter Van der Beken 2d58c35ce6 Fix for bug 778152 (Content window does not have an XMLHttpRequest property when accessed via an Xray wrapper in a subscript) - rename ProtoOrIfaceArray. r=bz.
--HG--
extra : rebase_source : c426270fc1ebee818629bd94dfc8d11af59bfc00
2012-10-09 20:50:27 +02:00
Boris Zbarsky fbeee7dfd0 Bug 793267. Add support for [Unforgeable] in WebIDL. r=peterv
Unforgeable attributes are defined directly on the object, not on the
prototype.  So we keep them in a separate spec array and define them
during object creation as needed.

This means that we have to pass that separate spec array to the Xray
helpers, unfortunately, which somewhat complicates those.
2012-10-24 16:10:49 -04:00
Boris Zbarsky 2a8465582e Bug 798187 part 1. Add support for dictionary return values. r=peterv 2012-10-22 13:08:52 -04:00
Boris Zbarsky 800cb6581d Bug 801712 part 3. Make object return values faster by only doing the JS_WrapValue if needed. r=peterv 2012-10-22 13:08:52 -04:00
Peter Van der Beken 9af14c557f Fix for bug 801083 (Remove old proxy-based list bindings). r=bz. 2012-10-13 14:50:24 +02:00
Peter Van der Beken e9a160c523 Fix for bug 802739 (Make parent wrapping for DOM bindings fall back to XPConnect for nsISupports classes).
--HG--
extra : rebase_source : 212a49060710b5b3791203b9472c9efcad578a58
2012-10-19 09:33:18 +02:00
Olli Pettay 39ef9c4b1c Bug 797806 - Helper method to handle stringified JSON in C++, r=khuey 2012-10-16 17:52:10 +03:00
Peter Van der Beken 7964385bcb Fix for bug 798264 (Split property tables). r=bz.
--HG--
extra : rebase_source : 71456ae48d3d3e6014e8095837f7942cfe733a37
2012-10-09 20:50:05 +02:00
Peter Van der Beken 29a1e67465 Fix for bug 799465 (Add complete support for non-nsISupports objects in new DOM bindings) - allow non-nsISupports object to be parents. r=bz.
--HG--
extra : rebase_source : 00c805373f99213bee8b17b24fed3024b8ac4752
2012-10-09 20:50:26 +02:00
Boris Zbarsky e743742df1 Bug 792890. Fix JS-wrapping of callback interfaces to just return the underlying JS object. r=peterv
There are several changes here:

1) When wrapping a callback interface object for JS, just extract the
   underlying JSObject from inside it and hand that object out.

2) Flag callback interface descriptors as "not concrete" (only matters
   for cases when they have constants on the interface object) and not
   wrappercached (will catch bugs if someone tries to treat them as a
   Gecko object).

3) Fix a preexisting bug in sequence wrapping where we'd try to
   JS_DefineElement twice if we were wrapping a null value for a
   sequence of nullable interface objects.
2012-10-10 15:57:57 -04:00
Bobby Holley 3dee0ce8e2 Bug 761695 - Implement expando traps for ProxyXrayTraits DOMXrayTraits. r=peterv
For new DOM proxies, we could probably use the Xray expando machinery for the
regular expando object as well, and free up one of the reserved slots. That's
more than I want to bite off for the moment, though.

I also decided not to block on bug 760095 and just kick the problem of globals
with new binding down the road a little bit.
2012-10-05 18:59:23 +02:00
Peter Van der Beken 96b3ddd3e3 Fix for bug 791347 (Support non-nsISupports refcounted natives and non-refcounted natives in new DOM bindings). r=bz/smaug.
--HG--
extra : rebase_source : cd6d98461d7fa3a07fa1361b4d840448122b6655
2012-09-19 15:02:37 +02:00
Boris Zbarsky 0334fe32b0 Bug 790273. Add support for [LenientThis] in WebIDL. r=peterv 2012-09-12 17:24:58 +01:00
Peter Van der Beken b84ab5be48 Bug 753517 part 5. Enable the list IC for new DOM bindings too. r=bz. 2012-08-24 09:32:26 -07:00
Luke Wagner ad90af9ca5 Bug 625199 - s/JSAutoEnterCompartment/JSAutoCompartment/ and make it infallible (r=bholley)
--HG--
extra : rebase_source : 12acf2288285f5caefd7fecea8207de3a47eab5b
2012-08-21 18:42:53 -07:00
Peter Van der Beken ee9eae3141 Fix for bug 768692 (Move DOM list binding generation to the new DOM binding codegen). r=bzbarsky.
--HG--
extra : rebase_source : 651a0fac4c9a87ef1c0a9cd91588c6421fd050c4
2012-05-22 15:46:20 +02:00
Ehsan Akhgari e368dc9c85 Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00
Boris Zbarsky 10c9046c35 Bug 747287 - Part 3: Add callback interface to allow JIT to interrogate DOM. (r=peterv) 2012-08-07 22:26:18 -07:00
Ms2ger 71696aa0f2 Bug 774705 - Part b: Throw a TypeError when trying to construct an interface without a constructor; r=bz 2012-08-04 09:44:00 +02:00
Ed Morley f4181983a1 Revert inbound to 3d5d1daa2505 to stop OS X M5 failures (backout not clean/could have been a bad merge) on a CLOSED TREE 2012-08-04 18:05:15 +01:00
Ms2ger 86de6cd109 Bug 774705 - Part b: Throw a TypeError when trying to construct an interface without a constructor; r=bz 2012-08-04 09:44:00 +02:00
Boris Zbarsky 423774779f Bug 771636 part 3. Implement default values for WebIDL strings. r=peterv 2012-07-31 00:22:23 -04:00
Peter Van der Beken a02b1d7ffe Fix for bug 774775 (XRayWrapper does not handle new bindings constants) - refactor code. r=bz.
--HG--
extra : rebase_source : 317d5942dde4427384320cb334f794f7fef37a2e
2012-07-18 13:52:07 +02:00
Ed Morley fcaa2b9642 Merge last PGO-green changeset of mozilla-inbound to mozilla-central 2012-07-18 13:32:24 +01:00
Ms2ger 23b178ab1f Bug 765464 - Part c: Throw some TypeErrors; r=khuey 2012-07-18 12:36:08 +02:00
Boris Zbarsky bf40f0efd9 Bug 773519 followup to make this code deal with silly string consumers too. No review. 2012-07-17 13:20:40 -04:00
Boris Zbarsky ca83439a51 Bug 773519. Speed up string argument conversion in DOM bindings by faking an XPCOM string. r=peterv 2012-07-17 12:18:53 -04:00
Ed Morley c9624f0f7a Backout 9deb8edb5070 (bug 773519), ea5a243a60f1 & 0cad1e553bea (bug 768537) for compilation failures 2012-07-17 17:48:11 +01:00
Boris Zbarsky 98cd60772a Bug 773519. Speed up string argument conversion in DOM bindings by faking an XPCOM string. r=peterv 2012-07-17 12:18:53 -04:00
Peter Van der Beken 209dc3f233 Fix for bug 762652 (Add the new DOM bindings API to CanvasRenderingContext2D). r=bz. 2012-06-13 17:14:15 +02:00
Matt Brubeck aa0f6555db Back out 438c192e561b and d6f341e77b68 (bug 762652, bug 762654) on suspicion of breaking Windows PGO tests 2012-06-27 16:24:53 -07:00
Peter Van der Beken be3b0761b1 Fix for bug 762652 (Add the new DOM bindings API to CanvasRenderingContext2D). r=bz.
--HG--
extra : rebase_source : 8e7a2722aa1fb089baa6c1aa8604dcd0e91c1ff2
2012-06-13 17:14:15 +02:00
Peter Van der Beken 356f838036 Fix for bug 756258 (Support union types in new DOM bindings). r=bz.
--HG--
extra : rebase_source : 5352801a4eb5085f73a5b6e78aa238c5c9d44179
2012-05-18 23:25:47 +02:00
Ms2ger 8448d8d0e6 Bug 765704 - Don't throw when setting XHR.responseType to an invalid value; r=bz 2012-06-21 09:11:07 +02:00
Peter Van der Beken c35972a603 Fix for bug 762651 (Add wrappercache to CanvasRenderingContext2D). r=bz. 2012-06-04 21:41:51 +02:00
Bill McCloskey 97faf3e3ba Bug 765034 - Fix unusual DOM proto array case (r=bz) 2012-06-18 17:04:38 -07:00
Boris Zbarsky 41725e7de3 Bug 750297 part 1. Add support for objects that do not have a wrapper cache in WebIDL bindings. r=peterv 2012-06-15 16:25:50 -04:00
Peter Van der Beken b36720b35a Fix for bug 760131 (Quickstub argument unwrapping fails for security-wrapped list proxy and paris binding objects). r=bz.
--HG--
extra : rebase_source : 945d58f3b73f25f05528e6c6d69745215cb4793a
2012-06-01 18:24:52 +02:00
Benoit Jacob 32d7e8c091 Bug 763604 - Use typename for type parameters of template template parameters in BindingUtil.h - r=bz 2012-06-12 17:19:52 -04:00
Boris Zbarsky 6c6503abf1 Bug 742153 part 3. Implement codegen for dictionary arguments. r=peterv
Another implementation option would be to put all the dictionaries in a single
file and have a static global set of ids which works across all dictionaries
and is initialized once at startup or so.  That would also handle cross-file
dictionary inheritance better.

One problem that remains is the fake descriptor business.  At the moment this
does not allow interface types inside dictionaries.  We could probably work
around this by either refactoring code to make it possible to get the declType
independently of the actual conversion template (whether because it lives in a
separate function or because the conversion template generator knows to just
return an empty string when the fake descriptor provirder is passed) or by
figuring out a way to pass an actual descriptor provider to dictionary codegen.
2012-06-12 10:22:05 -04:00
Boris Zbarsky 481937f7da Bug 761707 followup. Restore an assert that should not have gone away. r=ms2ger 2012-06-08 17:42:51 -04: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
Boris Zbarsky eab358758b Bug 761707 part 1. Rip out the various infrastructure for allowing different slot indices on different DOMJSClass instances. r=bholley 2012-06-06 15:59:46 -04:00
Boris Zbarsky 702a4a496f Bug 743906 part 2. Use Optional<> for optional arguments that don't have default values. r=peterv 2012-05-29 23:45:18 -04:00
Boris Zbarsky f99c90e58c Bug 755636 part 2. Add some tests (not exhaustive!) for sequence codegen and fix the bugs they uncover. r=peterv 2012-05-25 01:08:26 -04:00
Boris Zbarsky 1981fc313b Bug 755636 part 1. Convert sequence argument codegen to dom::Sequence. r=peterv 2012-05-25 01:08:22 -04:00
Boris Zbarsky 52ec2f0360 Bug 753522. Add support for controlling the existence of methods, properties, interface constants, etc with a pref. r=peterv 2012-05-23 12:44:48 -04:00
Peter Van der Beken 19fdb1c069 Fix for bug 756257 (Replace xpc_qsDOMString with a conversion function in new DOM bindings). r=bz.
--HG--
extra : rebase_source : 3f5ac89f72fade970f9f3505b93e51ac44ee7525
2012-05-18 23:25:46 +02: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
Boris Zbarsky d985ce38f4 Bug 748267 part 2. Implement codegen for dealing with sequence arguments. r=peterv 2012-05-15 14:23:29 -04:00
Boris Zbarsky 21f19a6619 Bug 748267 part 1. Refactor js-to-native conversion to make it not assume it's only happening on stack arguments. r=peterv
The changes in CastableObjectUnwrapper and CallbackObjectUnwrapper are
basically reindentation.  Similar for the actual conversion changes for all the
non-interface types, though for those the actual declaration of the thing being
converted to has moved out, since we may not be converting onto the stack.
2012-05-15 14:23:29 -04:00
Boris Zbarsky bf718df018 Bug 753518. Add an explicit way for GetParentObject to return an (nsISupports*,nsWrapperCache*) pair. r=peterv 2012-05-10 15:24:59 -04:00
David Rajchenbach-Teller 8860f0b8cd Bug 739740 - Export libc constants to JS. r=khuey 2012-05-09 12:00:48 +02:00
Boris Zbarsky 73485dea64 Bug 749485. Switch new DOM bindings to using a struct for keeping track of failures for fallible methods. r=peterv,bent
ErrorResult is in a separate header file so it can be included from all over the
place without having to pull in mozilla/dom/Utils.h and all the xpconnect gunk
that needs.
2012-05-05 21:15:11 -04:00
Phil Ringnalda 15ea61df18 Back out 1907bf7e6d7c (bug 749485) for build bustage 2012-05-05 20:33:59 -07:00
Boris Zbarsky d6697e4410 Bug 749485. Switch new DOM bindings to using a struct for keeping track of failures for fallible methods. r=peterv,bent
ErrorResult is in a separate header file so it can be included from all over the
place without having to pull in mozilla/dom/Utils.h and all the xpconnect gunk
that needs.
2012-05-05 21:15:11 -04:00
Ryan VanderMeulen d3d82de9f8 Back out b5fd22efe23d (bug 739740) due to bustage. r=TryFTW 2012-05-03 18:51:14 -04:00
David Rajchenbach-Teller d4d480c5c0 Bug 739740 - Export libc constants to JS. r=khuey,glandium 2012-04-30 12:14:38 +02:00
Peter Van der Beken 174872c252 Fix for bug 744772 (Trace the DOM interface object array). r=bz.
--HG--
extra : rebase_source : c9f27bed0eab0e6db03295050176ef986cf0b59b
2012-05-02 14:49:43 +02:00
Boris Zbarsky 5b65f56e64 Bug 748983. Fix the instanceof behavior for new bindings in situations where we don't need a custom hasInstance hook. r=peterv 2012-05-03 00:35:38 -04: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