Commit Graph

420 Commits

Author SHA1 Message Date
Boris Zbarsky
a4e95d314b Bug 766583 part 3. Stop declaring nullable things as const on the stack in bindings code. r=smaug 2013-04-25 19:03:06 -04:00
Boris Zbarsky
b10373cda6 Bug 766583 part 2. Stop declaring sequences as const on the stack in bindings code. r=smaug 2013-04-25 19:03:06 -04:00
Boris Zbarsky
9ba2beac5c Bug 766583 part 1. Stop declaring dictionaries as const on the stack in bindings code. r=smaug 2013-04-25 19:03:06 -04:00
Boris Zbarsky
7a5392b28d Bug 861493. When passing arguments to an Xray for a WebIDL constructor, make sure to do the argument unwrapping before entering the content compartment. r=bholley,waldo
There are several changes here:

1) Adds some MutableThis methods to Optional, Nullable, and dictionaries to
   effectively allow doing a const_cast without knowing the actual type being
   templated over.  I needed this because I do not in fact know that type in
   the relevant code.  I'm open to suggestions for a better name for this
   method.
2) Adds some operator& to RootedJSValue to make it look more like a JS::Value,
   and in particular so I can JS_WrapValue the thing in it.
3) Adds a Slot() method to NonNullLazyRootedObject, just like NonNull has.
4) Adds an operator& to LazyRootedObject to make it look more like JSObject* so
   I can JS_WrapObject the thing in it.
5) Implements the actual rewrapping of the arguments into the content compartment.
6) Fixes a small preexisting bug in which we didn't look at named constructors
   in getTypesFromDescriptor (this was causing my tests to not compile).
7) Changes Xrays to not enter the content compartment when calling a WebIDL
   constructor.
8) Adds some friend API to report things as not being functions.
2013-04-25 19:03:05 -04:00
Andrew McCreight
cd4ebfbb80 Bug 865544 - Add support for nsIDOMGlobalPropertyInitializer to JS-implemented WebIDL. r=bz 2013-04-25 14:31:42 -07:00
Boris Zbarsky
3da96fa3de Bug 863898. Add support for dictionary arguments in JS-implemented WebIDL bindings. r=mccr8 2013-04-25 12:29:55 -04:00
Boris Zbarsky
56032cd132 Bug 864727 part 7. Make the WebIDL binding Wrap methods take a handle for the scope object and use a Rooted for the parent. r=ms2ger 2013-04-25 12:29:55 -04:00
Boris Zbarsky
9c1973b5d2 Bug 864727 part 5. Make all the WrapObject methods take a handle for the scope object. r=ms2ger 2013-04-25 12:29:54 -04:00
Boris Zbarsky
0b6ba06beb Bug 864727 part 4. Pass a handle for the scope object to all the various Wrap*Object stuff in BindingUtils. r=ms2ger
Note: The JS::Rooted in CGWrapWithCacheMethod is just there until we start passing a handle to Wrap().
2013-04-25 12:29:53 -04:00
Boris Zbarsky
817ad5a3ec Bug 864727 part 3. Pass a handle for the parent object to WebIDL dictionary ToObject. r=ms2ger 2013-04-25 12:29:53 -04:00
Boris Zbarsky
37c0b22339 Bug 864727 part 2. Pass a handle for the scope object to union conversions. r=ms2ger,terrence 2013-04-25 12:29:52 -04:00
Andrew McCreight
e8ee5e30f6 Bug 863880 - Take a less ad hoc approach to forward declarations in bindings generation. r=bz 2013-04-25 08:42:43 -07:00
Andrew McCreight
c87f07b4ce Bug 863964 - clean up forward class declarations in codegen. r=bz 2013-04-25 08:42:43 -07:00
Boris Zbarsky
c6af618fd5 Bug 731746 part 4. When wrapping a JS-implemented webidl object, define the new object as a property on the implementing object. r=mccr8 2013-04-24 22:44:28 -04:00
Boris Zbarsky
de9b7862dc Bug 731746 part 3. Change JS-implemented webidl codegen to always invoke the parent constructor if there is a parent interface. r=mccr8 2013-04-24 22:44:28 -04:00
Boris Zbarsky
2f17e61fc4 Bug 731746 part 2. Change JS-implemented webidl codegen to pass an nsPIDOMWindow, not an nsISupports, to the object constructor. r=mccr8 2013-04-24 22:44:27 -04:00
Boris Zbarsky
20ab2b6db5 Bug 862629 part 2. Remove the now-unused scope object bit in js-to-native conversions. r=peterv 2013-04-24 14:59:15 -04:00
Boris Zbarsky
87e77a2b99 Bug 862629 part 1. Stop playing compartment games with WebIDL callbacks and just use the given object as-is. r=peterv 2013-04-24 14:59:15 -04:00
Boris Zbarsky
560478bb6b Bug 843264. Allow returning sequences of non-primitive types from callback methods. r=mccr8 2013-04-24 14:59:14 -04:00
Boris Zbarsky
8406904ff2 Bug 864535. Drop some comments from WebIDL proxy [[Delete]] implementations, since the spec has changed. r=waldo 2013-04-24 14:59:14 -04:00
Olli Pettay
f7b5debcae Bug 856338 - Using sequence<foo>? as an argument type crashes when passing non-null value, p=Ms2ger+smaug,r=bz
--HG--
extra : rebase_source : fb54e52db051584333c9430b0b000ee052e5b2d7
2013-04-23 02:49:49 +03:00
Peter Van der Beken
bd68680410 Bug 852094 - Support Unforgeable on proxy-based DOM bindings. r=bz. 2012-12-20 10:56:11 +01:00
Boris Zbarsky
18e59668bd Bug 863386. Add support for nullable enum arguments and return values. r=mccr8
This incidentally fixes bug 843355
2013-04-19 23:04:19 -04:00
David Zbarsky
8ce74aae9d Bug 857439 Part 3: Make sure to delete owned interfaces if wrapping fails r=bz 2013-04-19 04:49:21 -04:00
David Zbarsky
f5022bb55c Bug 857439 Part 2: Cleanup example codegen a bit r=bz 2013-04-19 04:49:21 -04:00
David Zbarsky
01f59de8e2 Bug 857439 Part 1: Disallow owned interfaces from having parents or children r=bz 2013-04-19 04:49:21 -04:00
David Zbarsky
ef87d4f932 Bug 857439 Part 0: Allow creators to return raw pointers for owned objects r=bz 2013-04-19 04:49:20 -04:00
Olli Pettay
b1ddad7f2c Bug 863094 - Infinity/-Infinity/NaN defaults for unrestricted types, r=bz
--HG--
extra : rebase_source : c2495008be9b084656222e6a0773c72d5224e9cc
2013-04-18 19:58:01 +03:00
Boris Zbarsky
0adaab0902 Bug 862610. When we have named constructors, make sure we managed to set up an interface object before looking for them. r=peterv 2013-04-18 01:21:46 -04:00
Olli Pettay
568cea39db Bug 862991 - If dictionary member needs cx, so should dictionary itself, r=bz
--HG--
extra : rebase_source : a495d79df021e896d3b7695a7d11da8d52559c28
2013-04-17 23:40:54 +03:00
Jeff Walden
f9d3bc73ed Bug 858677 - Fix up code not built by SpiderMonkey to use the newly-changed deletion signatures. r=bholley, r=billm 2013-04-05 21:22:55 -07:00
Boris Zbarsky
c72e933878 Bug 861064. Root WebIDL dictionary Init. r=smaug,terrence 2013-04-12 23:34:22 -04:00
Reuben Morais
a366543483 Bug 861032 - Fix -Wreinterpret-base-class warning on Codegen.py. r=bz
--HG--
extra : rebase_source : c05d51d8aeed182b85333a347f0b1dfb5d6b1ef9
2013-04-11 19:29:50 -07:00
Jacek Szpot
514f40e52a Bug 854503 - Rename JS unwrapping functions. r=bholley 2013-04-11 11:50:18 -07:00
Boris Zbarsky
536f3cb891 Bug 860551. Fix instanceof for prototype-less interface objects to be saner. r=dzbarsky 2013-04-11 14:31:06 -04:00
Boris Zbarsky
9c6066c314 Bug 860473 part 2. Root WebIDL dictionary ToObject. r=evilpie,smaug 2013-04-11 14:31:06 -04:00
Boris Zbarsky
4cf80a8cde Bug 860473 part 1. Root WebIDL dictionary ParseJSON. r=evilpie, smaug 2013-04-11 14:31:05 -04:00
Boris Zbarsky
a3971c86de Bug 857417. Trigger a fatal assertion when wrapping a wrappercached and nsISupports WebIDL object which has the wrapper cache before the nsISupports in its object layout. r=khuey 2013-04-08 17:04:21 -04:00
Ehsan Akhgari
a8ee3411c7 Backed out changeset d0d75e76d41f (bug 857417) for crashes during tests 2013-04-08 18:48:38 -04:00
Boris Zbarsky
3eba25eee5 Bug 857417. Trigger a fatal assertion when wrapping a wrappercached and nsISupports WebIDL object which has the wrapper cache before the nsISupports in its object layout. r=khuey 2013-04-08 17:04:21 -04:00
Boris Zbarsky
ecc404d587 Bug 688691. Warn when LenientThis actually causes us to not throw. r=ms2ger 2013-04-08 17:04:21 -04:00
Ryan VanderMeulen
24a4c17eff Backed out changeset a85d21e394c0 (bug 854503) for bustage. 2013-04-06 14:37:33 -04:00
Jacek Szpot
8ce12e971c Bug 854503 - Rename JS unwrapping functions. r=bholley 2013-04-04 12:14:32 +02:00
Nathan Froyd
c9dfdcad2f Bug 857254 - add CGTemplatedType and use it everywhere; r=bz 2013-04-02 15:29:03 -04:00
Nathan Froyd
c741af4b3b Bug 857254 - use CGIfWrapper more consistently; r=bz 2013-04-02 15:09:16 -04:00
Boris Zbarsky
6d1fe7f08a Bug 856819 part 2. Sort js-implemented interfaces in a given file so that the declarations in C++ come in the right order. r=mccr8 2013-04-03 22:22:16 -04:00
Boris Zbarsky
5f998ce2a9 Bug 856819 part 1. Refactor the dependency-sorting we do for dictionaries so that we can also use it for JS-implemented interfaces. r=mccr8 2013-04-03 22:22:16 -04:00
Boris Zbarsky
0bbbeb9739 Bug 856841. Don't pass in an implicit JSContext based on argument or return value types for JS-implemented interfaces. r=mccr8 2013-04-03 22:22:16 -04:00
Boris Zbarsky
d1d7bbfca7 Bug 852219 part 6. Handle cases when the C++ class we want to actually inherit from is not the one that the WebIDL interface is mapped to. r=mccr8 2013-04-03 22:22:16 -04:00
Boris Zbarsky
0b155803de Bug 852219 part 4. Fix forward-declarations and includes for JS-implemented interfaces. r=mccr8 2013-04-03 22:22:15 -04:00