Commit graph

63 commits

Author SHA1 Message Date
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
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
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Ms2ger
154b16a25d Don't return early from report_pending_exception() if the value is an unexpected object.
We will now dispatch the error event in this case as well.
2016-11-27 10:27:11 +01:00
Florian Hartwig
f064d9ad83 Invert conditional and return early from report_pending_exception 2016-10-13 23:28:24 +02:00
Anthony Ramine
b6bbd41e11 Remove GlobalRoot and GlobalRef 2016-10-06 21:36:00 +02:00
Anthony Ramine
86d2008137 Introduce GlobalScope::report_an_error 2016-10-06 21:35:46 +02:00
Anthony Ramine
ac5c4c2194 Make Error::to_jsval take a &GlobalScope 2016-10-06 21:35:42 +02:00
Anthony Ramine
896d8d4781 Make throw_dom_exception take a &GlobalScope 2016-10-06 21:35:39 +02:00
Anthony Ramine
fcb59d3057 Make reflect_dom_object take a &GlobalScope 2016-10-06 20:59:09 +02:00
Josh Matthews
27d44c8d10 Add a simple API to reject promises with DOM error values. 2016-09-22 16:16:58 -04:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
Ms2ger
b3050855e7 Implement report_an_error on GlobalRef. 2016-09-05 17:14:28 +02:00
Ms2ger
137845d47b Panic when stringifying an primitive fails.
This should not happen.
2016-09-02 11:44:46 +02:00
Ms2ger
ae38c53de7 Dispatch error events at the window object. 2016-09-02 11:44:44 +02:00
Ms2ger
5662f0d346 Remove the JSAutoCompartment from report_pending_exception.
It doesn't really belong there.
2016-08-26 17:59:31 +02:00
Guillaume Gomez
2f3f4a5bd6 Update rust-mozjs dependency 2016-08-24 12:56:49 +02:00
Ms2ger
5a61142720 Remove an unused argument to ErrorInfo::from_dom_exception. 2016-07-29 10:24:29 +02:00
Ms2ger
89efccc426 Update SpiderMonkey to m-c bcf4ff0c3eef.
This currently breaks Servo on Android, because there are a number of
interdependent changes that cannot easily land serially in a way that
keeps it working throughout. We expect to fix this in the near future.
2016-07-28 13:05:56 +02:00
bors-servo
7da28b7ca6 Auto merge of #12261 - szeged:gattcharacteristicfunctions, r=jdm
Missing steps of Characteristic's readValue, writeValue functions

<!-- Please describe your changes on the following line: -->
Add a check for the read property of the characteristic as described in https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-readvalue (Step 4.1)
Add two missing steps to characteristic's WriteValue function. https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-writevalue (Step 4 and 5)

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because, there are no Web Bluetooth test API implementation yet.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12261)
<!-- Reviewable:end -->
2016-07-06 11:11:26 -07:00
zakorgy
52e1d8325f Missing steps of Characteristic's readValue, writeValue functions 2016-07-06 09:31:52 +02:00
Eduard Burtescu
0db1faf876 Switch to using the new rooted!/RootedGuard API for rooting. 2016-07-04 20:59:01 +03:00
Anthony Ramine
27620320f3 Make report_pending_exception unsafe 2016-06-07 00:26:49 +02:00
Ms2ger
e4db7b6e9c Remove JS_SaveFrameChain and JS_RestoreFrameChain calls.
They were cargo-culted from Gecko, where they haven't been necessary for a
while either.
2016-05-17 16:32:04 +02:00
Anthony Ramine
cb5cd8d881 Say farewell to in-tree HeapSizeOf 2016-02-04 22:03:32 +01:00
Ms2ger
acb24e80b8 Use throw_type_error and throw_range_error from js. 2015-11-12 10:20:19 +01:00
Ms2ger
6b75078503 Make DOMString a newtype around String, rather than a typedef.
This should make it somewhat easier to experiment with alternative
representations in the future. To reduce churn, this commit leaves the String
field public, though.

Also, this will allow us to use the default String type to represent the IDL
USVString type, which explicitly forbids unpaired surrogates, ans as such is
a better match to the Rust String type.
2015-11-04 12:09:11 +01:00
Michael Wu
e733a7c46a Support the updated spidermonkey bindings 2015-10-14 15:30:52 -04:00
Ravi Shankar
889eec364b sorted the extern crate, mod & use declarations 2015-09-24 02:12:45 +05:30
Brandon Fairchild
de3547e401 Fix reported test-tidy errors for unmerged import blocks
This merges import blocks that were reported by tidy as unmerged.
2015-09-19 12:50:14 -04:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
Bogdan Cuza
45145108da Measure heap memory usage for more types. Fixes #6951 2015-08-13 21:44:41 +03:00
Tim Taubert
92874a89d2 Implement window.crypto.getRandomValues() 2015-07-03 18:34:00 +02:00
bors-servo
6247a96761 Auto merge of #6223 - nox:merge-generic-functions, r=Ms2ger
Merge generic funs to share them across all bindings (fixes #2684)



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6223)
<!-- Reviewable:end -->
2015-06-24 03:54:56 -06:00
Anthony Ramine
a90983553b Merge generic funs to share them across all bindings (fixes #2684) 2015-06-24 11:34:30 +02:00
Michael Wu
b7301ca06c Fix some warnings caused by the SM upgrade 2015-06-19 22:07:08 -04:00
Michael Wu
675267b782 Upgrade to SM 39 2015-06-19 18:42:48 -04:00
Anthony Ramine
2c6d2d3abe Make throw_not_in_union() throw a TypeError (fixes #6194) 2015-05-28 13:03:28 +02:00
Anthony Ramine
304b444ec7 Add missing range-related error types 2015-04-30 12:53:37 +02:00
Anthony Ramine
7197052c0d Uniformise root() methods
They now live in traits Rootable, OptionalOptionalRootable, OptionalRootable
and ResultRootable.
2015-04-28 09:22:45 +02:00
Aneesh Agrawal
f3aee90b06 Add Rust code for RangeErrors.
Implementation is alongside that of TypeErrors.
Note: the jsapi codes are reused for our own purposes, namely
distinguishing error_numbers in the get_error_message callback. See
comments in components/script/dom/bindings/error.rs for details.
2015-04-10 01:49:14 -04:00
Ms2ger
f8dec0fe58 Adjust the assertions in throw_dom_exception. 2015-04-08 20:44:49 +02:00
bors-servo
e521860a0e Auto merge of #5490 - nox:namednodemap, r=jdm 2015-04-07 09:31:20 -05:00
Anthony Ramine
fbe2e4b626 Add dom::bindings::error::Error::InUseAttribute 2015-04-06 22:27:00 +02:00
Eric Hegnes
e398725242 Consistently name enum members in dom::bindings::error::Error
Fixes #5521
2015-04-05 00:09:40 -04:00
Ms2ger
1604515fd9 Fix various build warnings. 2015-03-20 17:57:49 +01:00
Ms2ger
62b2c65348 Add support for throwing TypeErrors from DOM implementations. 2015-02-28 18:20:42 +01:00
Ms2ger
fbf4d44674 Clarify the documentation for dom::bindings::error::Error variants. 2015-02-28 18:20:42 +01:00
Ms2ger
6e3c130e6c Inline DOMException::new_from_error. 2015-02-28 18:20:42 +01:00
Ms2ger
4873682a3c Rename FailureUnknown to JSFailed. 2015-02-28 18:20:41 +01:00