Commit graph

56 commits

Author SHA1 Message Date
Simon Sapin
bea73951db Use #![register_tool] instead of #![register_attr]
CC https://github.com/rust-lang/rust/issues/66079
2019-11-15 17:24:42 +01:00
marmeladema
51e22fbc26 Remove some usage of unsafe code in Promise 2019-08-09 00:02:07 +01:00
marmeladema
88cacfb009 Modify *::get_cx methods to return a safe JSContext instead of a raw one 2019-07-24 09:53:10 +01:00
Kamil Niski
adb402487e Create a helper API for entering a DOM object's compartment
Revert some unnecessary changes

Fix fmt errors
2019-06-29 19:23:17 +02:00
Josh Matthews
63714c90fb Upgrade to Spidermonkey 67. 2019-06-26 18:10:46 -04:00
Josh Matthews
4328713f71 Update to SpiderMonkey 66. 2019-05-10 22:43:43 -04:00
Aron Zwaan
3229af509f Create new compartment in Promise constructor 2019-04-29 11:36:43 +02:00
Aron Zwaan
e2e6e2ac94 Pass InCompartment by value 2019-04-25 11:37:35 +02:00
Aron Zwaan
1b6949d4cf Add proof parameter to Promise::new_in_current_compartment 2019-04-24 19:46:10 +02:00
Aron Zwaan
c7c174f837 Add new consructor with &JSAutoCompartment parameter 2019-04-03 20:45:30 +02:00
Aron Zwaan
782b58587a Rename Promise::new to Promise::new_in_current_compartment 2019-04-03 20:45:30 +02:00
Manish Goregaokar
611dc4bc70 Remove now-unnecessary must_root and allow(unrooted_must_root) annotations 2019-01-04 15:05:07 -08:00
Manish Goregaokar
e28e73c81f Exempt Rc<Promise> from unrooted_must_root
fixes #22504
2019-01-04 09:34:04 -08:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
CYBAI
924a78c6c6 Implement unhandledrejection event 2018-10-18 19:13:22 +08:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Alan Jeffrey
74c1e00d81 Upgraded to SM 60 2018-08-20 18:22:29 -04:00
Alan Jeffrey
d0cc9d2cd5 Updated to mozjs v0.7.1. 2018-05-30 14:44:47 -05:00
Marcin Mielniczuk
356c57e628 Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
Anthony Ramine
50d31f7ec4 Don't access the reflector when dropping a Promise (fixes #18651)
The reflector may be dead already.
2018-03-15 09:53:33 +01:00
Simon Sapin
4d459bce32 Fix tyvar_behind_raw_pointer warnings
https://github.com/rust-lang/rust/issues/46906
2018-01-10 20:54:35 +01:00
Matt Brubeck
9cadf0981a Remove unnecessary Result::ok calls 2017-10-20 09:11:38 -07:00
Nicholas Nethercote
4506f0d30c Replace all uses of the heapsize crate with malloc_size_of.
Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.

This patch makes the following changes to the `malloc_size_of` crate.

- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
  (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).

- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
  support that operation.

- For `HashSet`/`HashMap`, falls back to a computed estimate when
  `enclosing_size_of_op` isn't available.

- Adds an extern "C" `malloc_size_of` function that does the actual heap
  measurement; this is based on the same functions from the `heapsize` crate.

This patch makes the following changes elsewhere.

- Converts all the uses of `heapsize` to instead use `malloc_size_of`.

- Disables the "heapsize"/"heap_size" feature for the external crates that
  provide it.

- Removes the `HeapSizeOf` implementation from `hashglobe`.

- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
  doesn't derive those types, unlike `heapsize`.
2017-10-18 22:20:37 +11:00
Anthony Ramine
386973efeb Make Promise::new_resolved unsafe 2017-09-22 14:18:32 +02:00
Anthony Ramine
a69c5da208 Make Promise::new_rejected unsafe 2017-09-22 14:18:28 +02:00
Anthony Ramine
860f2d806f Rename Promise::is_settled to Promise::is_fulfilled 2017-09-22 14:18:25 +02:00
Anthony Ramine
dabecfade6 Remove unused method Promise::then 2017-09-22 14:18:23 +02:00
Anthony Ramine
d31018d444 Make Promise::reject unsafe 2017-09-22 14:18:20 +02:00
Anthony Ramine
2400731bfc Make Promise::resolve unsafe 2017-09-22 02:15:28 +02:00
Anthony Ramine
af2e83f378 Make Promise::reject_error sound 2017-09-22 02:15:22 +02:00
Anthony Ramine
15acd1525e Make Promise::reject_native sound 2017-09-21 16:19:29 +02:00
Anthony Ramine
5addc2dfa3 Make Promise::resolve_native actually sound
We shouldn't have to pass a raw JSContext pointer, and to enter the
promise's context's compartment by hand.
2017-09-21 16:00:48 +02:00
Anthony Ramine
658dc8a501 Rename a couple of Promise methods 2017-09-21 15:35:04 +02:00
Alan Jeffrey
af8436c9be Implemented Houdini worklets. 2017-05-17 09:01:05 -05:00
mckaymatt
63f9ad022f Add way to get c_void ptr or c_char from caller 2017-04-04 16:46:52 -04:00
SendilKumar N
2996d3a413 removing mutHeapJs references
changes as per comments
2017-03-07 17:37:44 +08:00
Anthony Ramine
31e9d81c0f Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
Josh Matthews
e5eaab3523 Use Heap in DOM object reflector implementation to ensure GC barriers are used. 2017-01-20 11:32:19 -05:00
Corey Farwell
449f6337d4 Rename Reflectable to DomObject.
Fixes https://github.com/servo/servo/issues/8473.
2016-12-08 08:50:35 -10:00
Rahul Sharma
114c491111 Initial work on job queues for service workers 2016-11-22 01:29:37 +05:30
Ms2ger
558afe1786 Update js. 2016-11-02 13:25:49 +01:00
Anthony Ramine
d8e92bb271 Rename Reflectable::global_scope to global 2016-10-06 21:36:41 +02:00
Anthony Ramine
907781eb75 Remove Reflectable::global 2016-10-06 21:35:58 +02:00
Anthony Ramine
02d38e74e9 Make Promise::Reject and Resolve take a &GlobalScope 2016-10-06 21:35:54 +02:00
Anthony Ramine
ac5c4c2194 Make Error::to_jsval take a &GlobalScope 2016-10-06 21:35:42 +02:00
Anthony Ramine
ac5a4adf5f Make Promise::new take a &GlobalScope 2016-10-06 21:35:40 +02:00
Josh Matthews
e9c0606454 Remove maybe_ prefix from Promise methods. 2016-09-22 16:21:23 -04:00
Josh Matthews
498ccd41e8 Support an equivalent of Trusted<T> for Rc<Promise> objects named TrustedPromise. 2016-09-22 16:16:59 -04:00