Commit Graph

209 Commits

Author SHA1 Message Date
Jan-Ivar Bruaroey
e8b5e63e1b Bug 1033885 - add mediaDevices.getUserMedia with promises. r=bz, r=jesup 2014-09-20 02:20:41 -04:00
Paolo Amadini
ec9499744d Bug 1013625 - Process Promise resolution runnables outside of main event queue. r=bz,khuey 2014-10-28 12:08:19 +00:00
Paolo Amadini
f22950ba82 Bug 1083783 - Move Promise.cpp to a model where settlement immediately queues the invocation of "then" callbacks. r=bz 2014-10-28 12:08:19 +00:00
Nikhil Marathe
b8edaa21bb Bug 1039846 - Patch 4: FetchDriver with about:, blob: and data: fetching. r=baku
--HG--
extra : transplant_source : o%29%0E%5D%90%11%FA%1ExO%26%7E%9D_%F2%E7%0B%FE%21%B2
2014-10-06 11:01:20 -07:00
Boris Zbarsky
1f2f961464 Bug 1084030. Store the promise creation and settlement timestamps and expose that information via PromiseDebugging. r=nsm 2014-10-20 13:02:21 -04:00
Boris Zbarsky
32e9856cfd Bug 1083950. Add a way to get the promises that depend on a given promise via PromiseDebugging. r=nsm 2014-10-19 22:27:36 -04:00
Boris Zbarsky
8785d8bc26 Bug 1083851 part 4. Expose promise stacks on PromiseDebugging. 2014-10-19 22:27:12 -04:00
Boris Zbarsky
075178aa90 Bug 1083851 part 3. Capture stacks at promise fulfillment time. r=nsm 2014-10-19 22:27:12 -04:00
Boris Zbarsky
76f098299b Bug 1083851 part 2. Capture stacks at promise rejection time. r=nsm 2014-10-19 22:27:12 -04:00
Boris Zbarsky
f59edd37b0 Bug 1083851 part 1. Capture allocation stacks at promise creation time. r=nsm 2014-10-19 22:27:12 -04:00
Tom Schuster
0db58380c0 Bug 1069694 - Remove OldDebugAPI from the browser. r=shu 2014-10-12 19:37:41 +02:00
Peter Van der Beken
9254096129 Bug 1078744 - Replace SetIsDOMBinding with SetIsNonDOMBinding, remove nsWrapperCache::SetIsDOMBinding. r=bz.
--HG--
extra : rebase_source : 89c476cd9436530b2df5acc903909e34188417a0
2014-10-07 11:44:49 +02:00
Bobby Holley
b0d5796cba Bug 1070842 - Remove ambiguous globals from xpc::ErrorReporter and make meanings explicit. r=bz 2014-09-29 15:34:20 +02:00
Nikhil Marathe
1901b05e2d Bug 1062323 - Chained promises should resolve asynchronously. r=bz
--HG--
extra : transplant_source : %0C%E0%D2%0FEI/%D8s%E2%D07%8B%DE%25g%96%85%22r
2014-09-23 22:00:58 -07:00
Bobby Holley
54afe3012b Bug 1065811 - Expose isCallable()/isConstructor() in JS_PUBLIC_API. r=billm 2014-09-25 13:13:28 +02:00
Ryan VanderMeulen
96c3a38dc4 Backed out changeset ebd8df8e8631 (bug 1062323) for Gaia unit test failures. 2014-09-24 17:08:28 -04:00
Nikhil Marathe
2130046b95 Bug 1062323 - Chained promises should resolve asynchronously. r=bz 2014-09-22 16:37:40 -07:00
Bobby Holley
8dae0fc8ce Bug 1070696 - Rename xpc::GetNativeForGlobal to xpc::NativeGlobal and make it accept non-global JSObjects. r=smaug
The method is infallible, and making the callers invoke
js::GetGlobalForObjectCrossCompartment manually is dumb.
2014-09-21 21:31:53 +02:00
Ehsan Akhgari
d31e4c0d28 Bug 1068020 - Fix more bad implicit constructors in DOM; r=baku 2014-09-17 17:53:42 -04:00
Yuan Xulei
2ae87a78b2 Bug 1035060 - Implement AbortablePromise. r=bz 2014-09-12 10:18:49 +08:00
Bobby Holley
35d62e8c00 Bug 1062077 - Introduce xpc::ErrorReport. r=bz
I've got it! Let's just wrap the JS thing in an XPCOM thing that duplicates
its fields with a different ownership model! We totally need another one of
those, right? And we could even stick it in XPConnect! </sarcasm>

In seriousness - the code to own, format, and display error reports is
currently spread between the JS engine, JSErrorReporters, an async Runnable
abstraction, and elsewhere. We need to condense it somewhere to start chipping
away at this mess.
2014-09-08 16:30:10 -07:00
Ehsan Akhgari
bc7cc3893c Bug 1061023 - Fix more bad implicit constructors in DOM; r=baku
--HG--
extra : rebase_source : c80c5f9d7ae28286513cdb52ad76b46c240bdd5d
2014-09-01 18:26:43 -04:00
Ehsan Akhgari
0b2aaa5f23 Bug 1060987 - Fix more bad implicit constructors in DOM; r=baku
--HG--
extra : rebase_source : 01709017e97fdc96d1d53eb881efc1792118edc4
2014-09-01 20:49:25 -04:00
Phil Ringnalda
b656763114 Backed out 6 changesets (bug 1060982, bug 1061058, bug 1060987, bug 1061060, bug 1060930) for build bustage
CLOSED TREE

Backed out changeset c23b8418e6be (bug 1060987)
Backed out changeset a8cddc6bdffc (bug 1061060)
Backed out changeset b5af5cbdac3f (bug 1060982)
Backed out changeset 4912d451011a (bug 1060930)
Backed out changeset bdacbf453238 (bug 1061058)
Backed out changeset da6c71a8f5ae (bug 1060987)
2014-09-01 16:48:51 -07:00
Ehsan Akhgari
f1391c83bf Bug 1060987 - Fix more bad implicit constructors in DOM; r=baku 2014-09-01 18:00:53 -04:00
Yuan Xulei
0b76b1d942 Bug 1055925 - Refactor promise to merge main thread and worker thread tasks into a single task. r=nsm 2014-08-19 18:39:56 +08:00
Andrea Marchesini
042b7cf53f Bug 1047398 - ServiceWorker should use WeakRef instead nsTWeakRef, r=smaug 2014-08-01 17:42:19 +01:00
Ehsan Akhgari
38ec6af068 Bug 1045436 - Fix more bad implicit constructors in XPCOM; r=froydnj 2014-07-29 20:43:56 -04:00
Ms2ger
e99bd12a4b Bug 1043963 - Collapse test-only moz.build files under dom/ into ancestor moz.build files; r=ted
There is very little benefit to having another layer of moz.build files, and
removing them will speed up the build a minimal amount. It also paves the way
for removing TEST_DIRS, which could simplify the build system somewhat.
2014-07-26 08:17:24 +02:00
Mike Hommey
d10b15b035 Bug 1041860 - Avoid setting FINAL_LIBRARY to libraries that further use a FINAL_LIBRARY. r=mshal 2014-07-23 08:37:51 +09:00
Nikhil Marathe
86f5bb969b Bug 1023547 - Fix intermittent dom/workers/test/test_promise.html failure. r=bz
--HG--
extra : transplant_source : %F5%A9%DER%BA%11%E3%2C%E3R%C8%40%F3%5E%D5%C3%A6%FE%9D%90
2014-07-18 18:13:47 -07:00
Ryan VanderMeulen
379f8a7ad4 Backed out changeset 38bfa2af2bd8 (bug 1023547) for making test_promise.html perma-fail. 2014-07-20 15:39:04 -04:00
Nikhil Marathe
c0b86de32d Bug 1023547 - Fix intermittent dom/workers/test/test_promise.html failure. r=bz 2014-07-18 18:13:47 -07:00
Boris Zbarsky
48011830e3 Bug 966452 part 2. Report all unhandled Promise rejections. r=nsm,bholley 2014-07-04 01:24:59 -04:00
Boris Zbarsky
c03ab46f93 Bug 1040263. Eagerly create and preserve Promise reflectors so we always have them available during unlink. r=nsm,bholley. 2014-07-18 21:31:11 -04:00
Benoit Girard
e7aea75462 Bug 1037691 - Fix instances where refcounted classes expose a public destructor. r=ehsan,bent,mayhemer,jrmuizel 2014-07-15 11:37:45 -04:00
Benoit Jacob
57ed0c585c Bug 1035394 - Fix dangerous public destructors in dom - r=ehsan 2014-07-08 17:23:17 -04:00
Carsten "Tomcat" Book
39f737bb90 Backed out changeset 42f348168125 (bug 966452) 2014-07-04 08:23:38 +02:00
Boris Zbarsky
4a3080b3df Bug 966452 part 2. Report all unhandled Promise rejections. r=nsm 2014-07-04 01:24:59 -04:00
Nikhil Marathe
4d7bfd252f Bug 984048 - Patch 4 - Handle parse and uncaught errors. r=khuey
--HG--
extra : rebase_source : 463146233c874c2f2c63c018f2a43a66ca9ea49a
2014-07-02 17:48:35 -07:00
Boris Zbarsky
e2f0608365 Bug 966471. Add some facilities for examining the state of a promise via a PromiseDebugging utility namespace. r=nsm,peterv 2014-07-02 00:19:48 -04:00
Wes Kocher
bbc09af3cc Backed out 3 changesets (bug 984048) for breaking hazard builds.
Backed out changeset 2d0c34b7045f (bug 984048)
Backed out changeset c18211a2afa1 (bug 984048)
Backed out changeset 30fa36882d57 (bug 984048)
2014-07-01 20:29:08 -07:00
Nikhil Marathe
3d69f76ee1 Bug 965644 - Fix intermittent oranges on promise tests. r=bz 2014-07-01 17:33:00 -07:00
Nikhil Marathe
81a3fad979 Bug 984048 - Promise::MaybeReject ErrorEvent overload no longer needed. Fix compile error. r=bustage
--HG--
extra : amend_source : 5fcbc1c3912503e98f36fce514ddc2433da31a3e
2014-07-01 17:07:47 -07:00
Nikhil Marathe
8ece823137 Bug 984048 - Patch 4 - Handle parse and uncaught errors. r=khuey 2014-07-01 16:43:13 -07:00
Ryan VanderMeulen
6b74ec8899 Backed out changesets bacfdc83424a and 7d12b5d7446f (bug 984048) for crashes. 2014-06-30 17:22:47 -04:00
Nikhil Marathe
40400978a6 Bug 984048 - Patch 4 - Handle parse and uncaught errors. r=khuey
--HG--
extra : rebase_source : 9cc36dea950be96fba079877c2d67b76f8383635
2014-06-30 13:31:02 -07:00
Benoit Jacob
747dcfc8a0 Bug 1028588 - Fix dangerous public destructors in the rest of dom/ - r=ehsan 2014-06-23 15:56:07 -04:00
Kyle Huey
b29ba7e116 Bug 1023033: Remove unnecessary MOZ_COUNT_CTOR/DTOR from promise code. r=mccr8 2014-06-17 09:39:16 -07:00
Ben Kelly
fa96ef9593 Bug 1025973 - Part 2: Do not pass JSContext to static webidl methods in non-worker case. r=bz 2014-06-16 12:52:00 -04:00
Ben Kelly
d96ec8b401 Bug 1025973 - Part 1: Rename GlobalObject::GetContext() to Context(). r=bz 2014-06-16 14:08:00 -04:00
Boris Zbarsky
2bb59ed300 Bug 1009675 part 2. Return WebIDL 'any' values as handles. r=peterv 2014-06-11 16:26:52 -04:00
Nikhil Marathe
abe25b169a Bug 1020226 - Fix unhandled Promise rejection handling in workers. r=khuey
* * *
Bug 1020226 - Test case to crash browser when using Promises on workers. r=khuey
2014-06-05 12:21:56 -07:00
Boris Zbarsky
ce7efbba1f Bug 1016560. Remove the footgun of rejecting promises with arbitrary objects. r=khuey 2014-06-03 11:38:38 -04:00
Ryan VanderMeulen
a1fd06248a Backed out changesets 6d1c36585219 and bd403a727849 (bug 1016560) for mochitest-other failures.
CLOSED TREE
2014-06-03 13:48:49 -04:00
Boris Zbarsky
59db282a5f Bug 1016560. Remove the footgun of rejecting promises with arbitrary objects. r=khuey 2014-06-03 11:38:38 -04:00
Nikhil Marathe
25ee8c2808 Bug 1008467 - Callbacks to then() resolve Promise asynchronously. r=bz 2014-05-20 14:55:36 -07:00
Nikhil Marathe
7f1cb23bae Bug 1009569 - Promise then() must be called on a clean stack. r=bz 2014-05-20 14:21:13 -07:00
Nick Lebedev
b7223435b4 Bug 998002 - Rename nsContentUtils::Get{Subject,Object}Principal to nsContentUtils::{Subject,Object}Principal. r=bholley 2014-05-13 11:58:00 +02:00
Gene Lian
84c4e2d3fc Bug 949325 - C++ wrapper to support DataStore API on the worker (part 2-1, provide a proxy to resolve/reject Promise on workers). r=baku,nsm,khuey 2014-02-24 21:56:54 +08:00
Jon Coppeard
bed7fc43d9 Bug 959787 - Handlify remaining JS APIs r=terrence r=bz r=bholley 2014-04-30 10:10:33 +01:00
Andrea Marchesini
e6576fb574 Bug 995163 - wrap the Promise value in NativePromiseCallback, r=bz 2014-04-29 22:12:14 +01:00
Birunthan Mohanathas
4de1915f30 Bug 900903 - Part 2: Change uses of numbered macros in nsCycleCollectionParticipant.h to the variadic variants. r=smaug 2014-04-25 12:49:00 -04:00
Boris Zbarsky
04d5a7c98d Bug 996831. Add a ToJSValue overload for nsresult, to allow rejecting promises from C++ more easily. r=bholley 2014-04-16 15:13:41 -04:00
Ryan VanderMeulen
1829e78b29 Backed out 3 changesets (bug 996474, bug 996831) for B2G bustage on a CLOSED TREE.
Backed out changeset 8f98a4c2257f (bug 996831)
Backed out changeset 7acce569bd84 (bug 996831)
Backed out changeset 1845b09c7578 (bug 996474)
2014-04-16 19:31:41 -04:00
Boris Zbarsky
e152157843 Bug 996831. Add a ToJSValue overload for nsresult, to allow rejecting promises from C++ more easily. r=bholley 2014-04-16 15:13:41 -04:00
Jon Coppeard
2a5c843ea4 Bug 993413 - Remove use of JS_Add/Remove*Root in favour of JS::PersistentRooted where possible r=terrence r=bz r=bholley 2014-04-16 09:47:53 +01:00
Boris Zbarsky
e862c92db8 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
Boris Zbarsky
96db362740 Bug 991080. Add an overload of Promise::ArgumentToJSValue that lets callers pass in an nsTArray to MaybeResolve() a promise with a JS array. r=khuey 2014-04-10 00:58:43 -04:00
Boris Zbarsky
3738611b99 Bug 993889 part 1. Remove "scope" argument from nsContentUtils::WrapNative. r=bholley 2014-04-10 00:58:41 -04:00
Andrea Marchesini
f8f47ff494 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
423901664f Backed out changeset 7fa9564a2486 (bug 974893) for build failures 2014-04-09 09:08:39 +01:00
Andrea Marchesini
47d3ae2f7e 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
dfd0a0d909 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
a0c3167371 Bug 991742 part 9. Remove the "scope" argument of WrapNewBindingObject. r=bholley 2014-04-08 18:27:19 -04:00
Boris Zbarsky
35fca5eeeb 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
56f44fdf10 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
bed9b485be 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
Boris Zbarsky
0087f2d16b Bug 990242. Remove some dead Promise code. r=nsm 2014-04-01 01:58:28 -04:00
Nikhil Marathe
9892fb5884 Bug 956197 - Tests to check Promises can accept iterators. r=bz
--HG--
extra : amend_source : 7989612b44c67393de7f74fdd0054587722cc79a
2014-03-28 08:17:53 -07:00
Yuan Xulei
be52e2973e Bug 934368 - Extend Promise#MaybeResolve to receive boolean value. r=smaug 2014-02-26 16:18:34 +08:00
Yuan Xulei
858942196b Bug 910412 - Implement |getRoot|, |createDirectory| and |get| for Directory. r=dhylands, r=smaug 2014-03-05 11:25:40 +08:00
Nikhil Marathe
64ce0e2c51 Bug 967005 - Report rejected promises when worker stops running. r=bent
--HG--
extra : rebase_source : 3f569387061151b1afb5f09a8d1ca04e85e376e1
2014-03-12 07:31:03 -07:00
Wes Kocher
6d09c880fc Backed out changeset 716ba77a9d0a (bug 967005) for ASAN m-4 failures 2014-03-11 17:23:35 -07:00
Nikhil Marathe
6df7889086 Bug 967005 - Report rejected promises when worker stops running. r=bent 2014-03-11 16:10:41 -07:00
Ryan VanderMeulen
5099e8a290 Backed out 5 changesets (bug 910412) for intermittent crash whack-a-mole.
Backed out changeset e3eb9463b3e1 (bug 910412)
Backed out changeset d5863d302bde (bug 910412)
Backed out changeset 422b66d4b1ca (bug 910412)
Backed out changeset 3431d59d752e (bug 910412)
Backed out changeset b1c0310cdac1 (bug 910412)
2014-03-11 12:17:03 -04:00
Richard Barnes
31c4799582 Bug 978435 - Add ArgumentToJSVal overload for typed arrays. r=bz 2014-03-10 08:55:46 -04:00
Yuan Xulei
260442ce9a Bug 910412 - Implement |getRoot|, |createDirectory| and |get| for Directory. r=dhylands, r=smaug 2014-03-05 11:25:40 +08:00
Bobby Holley
f8b76527a8 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
Luke Wagner
0b60875286 Bug 976763 - Change DescribeStack not to return JSScripts or JSFunctions (r=bz)
--HG--
extra : rebase_source : d9a784df61c00421c9a1e360f92ffc763bf49858
2014-02-25 09:43:14 -06:00
Kyle Huey
566ed0b282 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
9715dca93b 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
2166b04394 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
56c89838ab Bug 966384 - Promises on workers use correct busy count. r=khuey 2014-02-17 12:24:36 +05:30
Nikhil Marathe
bf562b1549 Backout 3011b2b7f82f (bug 966384) for unused variable failures. r=backout
CLOSED TREE

--HG--
extra : amend_source : dfb81e133bca73ba3c5ad959593c5d3d444f8506
2014-02-17 11:06:03 +05:30
Nikhil Marathe
0556e2f175 Bug 966384 - Promises on workers use correct busy count. r=khuey
--HG--
extra : rebase_source : 23ad7b8682a8ed6d0062dd9234ee28a18a92a54b
2014-02-17 10:19:15 +05:30
Jon Coppeard
52381adba2 Bug 969812 - Convert JS_NewArrayObject to use HandleValueArray r=terrence r=bz 2014-02-12 10:50:46 +00:00
Nikhil Marathe
dee9164b47 Bug 966348 - Rename Promise.cast to Promise.resolve. r=bz 2014-02-10 09:27:02 -08:00
Nikhil Marathe
48b814058b Bug 918806 - Enable DOM Promises. sr=bz
--HG--
extra : rebase_source : dbc7ef836fe7c2a71f38fedda004d7f988361a85
2014-01-30 13:14:00 -08:00
Ryan VanderMeulen
3a41ee3937 Backed out changesets 6db8b08a3aea and 1d7c2025bb56 (bug 918806) for B2G mochitest failures. 2014-01-30 14:46:36 -05:00