Commit Graph

159 Commits

Author SHA1 Message Date
Boris Zbarsky
0ca109ca20 Bug 994453 part 1. Factor out the to-JS conversions from Promise.h into mozilla::dom::ToJSValue methods. r=bholley
Apart from moving the methods, I made the following changes:

1)  Renamed them to ToJSValue.
2)  Inlined the boolean overload.
3)  Added overloads that take integer types.
4)  Changed the order of the aCx and aArgument arguments so aCx comes first.
5)  Renamed "abv" to "obj" in the typed array overload.
2014-04-10 14:57:07 -04:00
Andrea Marchesini
b89f8fc1bb Bug 974893 - Remove EnterCompartment and keep the global with the value in Promise, r=bz 2014-04-09 09:30:24 +01:00
Ed Morley
7162b65fa4 Backed out changeset 7fa9564a2486 (bug 974893) for build failures 2014-04-09 09:08:39 +01:00
Andrea Marchesini
b27a1641cd Bug 974893 - Remove EnterCompartment and keep the global with the value in Promise, r=bz 2014-04-09 08:32:46 +01:00
Boris Zbarsky
3891aa3158 Bug 991742 part 10. Remove the "aScope" argument from the Promise ArgumentToJSValue() methods. r=bholley 2014-04-08 18:27:19 -04:00
Boris Zbarsky
9462dfc340 Bug 991742 part 9. Remove the "scope" argument of WrapNewBindingObject. r=bholley 2014-04-08 18:27:19 -04:00
Boris Zbarsky
b95c359828 Bug 991742 part 8. Remove the "aScope" argument of WebIDL/nsWrapperCache WrapObject() methods. r=bholley
This patch was mostly generated with the following command:

find . -name "*.h" -o -name "*.cpp" | xargs sed -e '/WrapObject(JSContext/ {; N; s/\(WrapObject(JSContext *\* *a\{0,1\}[Cc]x\),\n\{0,1\} *JS::Handle<JSObject\*> a\{0,1\}[sS]cope/\1/ ; }' -i ""

and then reverting the changes that made to
dom/bindings/BindingUtils.h, since those WrapObject methods are not
the ones we're trying to change here, plus a bunch of manual fixups
for cases that this command did not catch (including all the callsites
of WrapObject()).
2014-04-08 18:27:18 -04:00
Boris Zbarsky
ae0180ee85 Bug 991742 part 6. Remove the "aScope" argument of binding Wrap() methods. r=bholley
This patch was mostly generated with this command:

find . -name "*.h" -o -name "*.cpp" | xargs sed -e 's/Binding::Wrap(aCx, aScope, this/Binding::Wrap(aCx, this/' -e 's/Binding_workers::Wrap(aCx, aScope, this/Binding_workers::Wrap(aCx, this/' -e 's/Binding::Wrap(cx, scope, this/Binding::Wrap(cx, this/' -i ""

plus a few manual fixes to dom/bindings/Codegen.py, js/xpconnect/src/event_impl_gen.py, and a few C++ files that were not caught in the search-and-replace above.
2014-04-08 18:27:17 -04:00
Boris Zbarsky
aaca6e7051 Bug 991753. Make sure we're in the right compartment before we try wrapping our Promise in Promise::GetOrCreateWrapper. r=bholley 2014-04-03 23:32:11 -04:00
Yuan Xulei
97594abedb Bug 934368 - Extend Promise#MaybeResolve to receive boolean value. r=smaug 2014-02-26 16:18:34 +08:00
Nikhil Marathe
fe7ec2e2ac Bug 967005 - Report rejected promises when worker stops running. r=bent 2014-03-12 07:31:03 -07:00
Wes Kocher
b1a06e7bcb Backed out changeset 716ba77a9d0a (bug 967005) for ASAN m-4 failures 2014-03-11 17:23:35 -07:00
Nikhil Marathe
84637aeb6e Bug 967005 - Report rejected promises when worker stops running. r=bent 2014-03-11 16:10:41 -07:00
Bobby Holley
e0f74f6583 Bug 977340 - Clean up cx usage in Promises. r=bz
None of these are hazards, because we already make sure to push the JSContext
in the cases where we do anything meaningful in JSAPI. But the current setup
trips the new assertions, and is ugly to boot. Let's fix it.
2014-03-04 10:05:08 -08:00
Kyle Huey
9c46ca15f6 Bug 974120: Add helpers for using Promse::MaybeResolve/MaybeReject from C++. r=bz
Using JSAPI is tedious and error-prone.  It's much better to handle that once in the Promise code and allow callers to pass C++ objects.
2014-02-25 13:34:55 -08:00
William Chen
048e228e69 Bug 973988 - DOM Promise constructor should call the executor with "undefined" as thisArg. r=bz 2014-02-19 10:59:23 -08:00
Boris Zbarsky
cffedad1d1 Bug 970764. Remove support for non-optional "any" arguments values, since "any" needs to be able to include undefined anyway. Have "any" arguments and dictionary entries default to undefined unless the IDL explicitly says "= null". r=khuey 2014-02-19 10:13:38 -05:00
Nikhil Marathe
e95bca13ec Bug 966384 - Promises on workers use correct busy count. r=khuey 2014-02-17 12:24:36 +05:30
Nikhil Marathe
d5f5c4811c Backout 3011b2b7f82f (bug 966384) for unused variable failures. r=backout
CLOSED TREE
2014-02-17 11:06:03 +05:30
Nikhil Marathe
4e184abd52 Bug 966384 - Promises on workers use correct busy count. r=khuey 2014-02-17 10:19:15 +05:30
Jon Coppeard
0df72e25fb Bug 969812 - Convert JS_NewArrayObject to use HandleValueArray r=terrence r=bz 2014-02-12 10:50:46 +00:00
Nikhil Marathe
784c3ec66d Bug 966348 - Rename Promise.cast to Promise.resolve. r=bz 2014-02-10 09:27:02 -08:00
Nikhil Marathe
fe6cd7fc28 Bug 918806 - Enable DOM Promises. sr=bz 2014-01-30 13:14:00 -08:00
Ryan VanderMeulen
4ffd4d58ec Backed out changesets 6db8b08a3aea and 1d7c2025bb56 (bug 918806) for B2G mochitest failures. 2014-01-30 14:46:36 -05:00
Nikhil Marathe
61dbd07aa3 Bug 918806 - Enable DOM Promises. sr=bz 2014-01-30 09:41:43 -08:00
Bobby Holley
9fce7fff11 Bug 872273 - Remove non-cx variant of ErrorFromException, and make it take a HandleObject. r=Waldo
We're going to need to start doing more work in js_ErrorFromException, which
will require a |cx| and may GC.
2014-01-30 09:30:29 -08:00
Nikhil Marathe
9c3cfd1a18 Bug 945766 - DOM Promise should pass Promise/A+ tests. r=bz 2014-01-28 10:14:57 -08:00
Nikhil Marathe
46fc87707d Bug 939332 - Implement Promise.all, Promise.cast, Promise.race. r=bz 2013-11-19 13:53:00 -08:00
Nikhil Marathe
8d0052198d Bug 879245 - Implement thenables for Promises. r=bz 2014-01-23 10:47:29 -08:00
Nikhil Marathe
1476255d12 Bug 959375 - Add Promise Resolve/Reject overloads accepting a window. r=baku 2014-01-13 14:36:03 -08:00
Nikhil Marathe
0875d3ee10 Bug 958684 - Fix AsyncErrorReporter leak in Promises. r=mccr8 2014-01-10 14:07:46 -08:00
Ben Turner
081c6e49da Bug 914762 - Switch Workers to use a normal nsThread event loop, r=mrbkap. 2013-10-23 06:16:49 -07:00
Nikhil Marathe
dc7c2bb825 Bug 936700 - Worker Preferences cache. r=bent 2013-11-24 11:27:15 -08:00
Nikhil Marathe
ee95f9bfe6 Bug 915233 - DOM Promises on Workers. r=baku,bent,smaug,bz sr=sicking 2013-11-24 11:26:07 -08:00
Nikhil Marathe
85cbc6ba5f Bug 942255 - UsesSystemPrincipal() in Promise::EnabledForScope() on Workers. r=bz 2013-11-22 14:13:26 -08:00
Boris Zbarsky
884da06296 Bug 941437 part 2. Remove the unused cx argument from UNWRAP_OBJECT and UNWRAP_WORKER_OBJECT. r=smaug 2013-11-21 07:51:16 -05:00
Nikhil Marathe
7ed16b392a Bug 939906 - Make Promise.resolve(), Promise.reject(), Promise.prototype.then() and Promise.prototype.catch() spec compliant. r=baku 2013-11-19 13:29:47 -08:00
Nikhil Marathe
c034e6930c Bug 882076 - C++ callbacks to DOM Promises. r=baku,mccr8 2013-11-19 10:43:51 -08:00
Nikhil Marathe
d0639e1f14 Bug 939909 - Get rid of Optional<> from internal Promise functions. r=bz 2013-11-19 10:39:51 -08:00
Nikhil Marathe
8bac11b4b4 Bug 933010 - AsyncErrorReporter takes bool isChromeError. r=bz 2013-10-30 16:17:36 -07:00
Michael Henretty
4b9fd4a73a Bug 899574 - Add public API for resolving promises in C++. r=baku 2013-09-26 11:09:16 -07:00
Reuben Morais
69ab2ad7e9 Backed out 2 changesets (bug 899574) for breaking Gaia tests 2013-10-07 14:41:13 -04:00
Michael Henretty
1ac9d9204b Bug 899574 - Add public API for resolving promises in C++. r=baku 2013-09-26 11:09:16 -07:00
Andrea Marchesini
a03d55dffb Bug 911213 - Implement new promise constructor, r=bz 2013-09-11 18:03:04 +02:00
Ms2ger
869341c41c Bug 913923 - Part b: Move OwningNonNull into its own header; r=dzbarsky 2013-09-10 09:03:37 +02:00
Andrew McCreight
cee0d6bfae Bug 883920 - use templates for {Hold,Drop}JSObjects. r=peterv 2013-08-16 13:10:17 -07:00
Boris Zbarsky
4ee066317f Bug 903419 part 2. Report unhandled rejections in promises. r=smaug,bholley,luke 2013-08-29 00:30:06 -04:00
Andrew McCreight
9af4a9cb8a Bug 904826 - Remove some unneeded nsLayoutStatics calls. r=smaug,bholley,bz 2013-08-27 15:39:02 -07:00
Andrew McCreight
251902e99a Backed out changeset 365053e73efa for build bustage on this CLOSED TREE. 2013-08-27 09:54:01 -07:00
Andrew McCreight
f930d02918 Bug 904826 - Remove some unneeded nsLayoutStatics calls. r=smaug 2013-08-20 14:19:33 -07:00