Commit graph

59 commits

Author SHA1 Message Date
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Anthony Urena
ef0e93c9b1 Updates Bluetooth type to use BufferSource 2018-03-24 20:46:14 -04:00
Anthony Urena
5bf2e71407 Switches characteristic to use BufferSource 2018-03-24 20:46:13 -04:00
Simon Sapin
aa15dc269f Remove use of unstable box syntax.
http://www.robohornet.org gives a score of 101.36 on master,
and 102.68 with this PR. The latter is slightly better,
but probably within noise level.
So it looks like this PR does not affect DOM performance.

This is expected since `Box::new` is defined as:

```rust
impl<T> Box<T> {
    #[inline(always)]
    pub fn new(x: T) -> Box<T> {
        box x
    }
}
```

With inlining, it should compile to the same as box syntax.
2017-10-16 17:16:20 +02:00
Anthony Ramine
f87c2a8d76 Rename Root<T> to DomRoot<T>
In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>,
where Root<T> will be able to handle all the things that need to be
rooted that have a stable traceable address that doesn't move for the
whole lifetime of the root. Stay tuned.
2017-09-26 09:49:10 +02:00
Anthony Ramine
577370746e Rename DOMRefCell<T> to DomRefCell<T>
I don't want to do such a gratuitous rename, but with all the other types
now having "Dom" as part of their name, and especially with "DomOnceCell",
I feel like the other cell type that we already have should also follow
the convention. That argument loses weight though when we realise there
is still DOMString and other things.
2017-09-26 09:49:08 +02:00
Anthony Ramine
7be32fb237 Rename JS<T> to Dom<T> 2017-09-26 09:48:55 +02:00
Anthony Ramine
0e3c54c191 Rename dom::bindings::js to dom::bindings::root 2017-09-26 02:19:05 +02:00
Anthony Ramine
d246c5cf20 Remove JSContext argument from AsyncBluetoothListener::handle_response 2017-09-22 13:56:31 +02:00
Anthony Ramine
af2e83f378 Make Promise::reject_error sound 2017-09-22 02:15:22 +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
7875fea6cf Use absolute paths in the event handlers macros 2017-09-01 11:54:09 +02:00
Anthony Ramine
31e9d81c0f Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
Zakor Gyula
5287cd3bea Bluetooth Permission API integration 2017-02-13 14:58:06 +01:00
Zakor Gyula
fae2beeda0 Reorder startNotifications steps 2017-02-10 13:32:07 +01:00
Prudhvi Rampey
29340b7adf Cleaned up ripples due to MutJS to JS type change 2017-01-07 01:16:02 +05:30
Attila Dusnoki
b0103682fa Implement GetGATTChildren 2016-12-16 21:02:58 +01:00
bors-servo
6ee175bf70 Auto merge of #14567 - szeged:represented-attributes, r=jdm
Check if represented attributes are cached

<!-- Please describe your changes on the following line: -->
Improve existing cache checks in `/bluetooth/lib.rs`, and update Step comments in `script/dom` corresponding to this.

---
<!-- 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] There are tests for these changes OR

<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14567)
<!-- Reviewable:end -->
2016-12-14 15:29:43 -08:00
Zakor Gyula
c3e771274a Check if represented attributes are cached 2016-12-14 22:06:55 +01:00
Anthony Ramine
1327ebd52f Remove HeapGCValue
It could be used to have mutable JSVal fields without GC barriers.
With the removal of that trait, MutHeap and MutNullableHeap can respectively
be replaced by MutJS and MutNullableJS.
2016-12-12 10:47:54 -10:00
Corey Farwell
449f6337d4 Rename Reflectable to DomObject.
Fixes https://github.com/servo/servo/issues/8473.
2016-12-08 08:50:35 -10:00
Valentin Fokin
c33d89c92c Moved the AttributeInstanceMaps from bluetooth to bluetoothDevice. 2016-12-02 12:50:53 +01:00
Zakor Gyula
8dd100f74f Step annotations for WebBluetooth functions 2016-11-29 18:24:28 +01:00
bors-servo
7be32770b1 Auto merge of #14393 - dati91:fix, r=jdm
WriteValue should return undefined

<!-- Please describe your changes on the following line: -->

<!-- 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

<!-- Either: -->
- [X] There are tests for these changes

<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14393)
<!-- Reviewable:end -->
2016-11-29 06:11:06 -08:00
Attila Dusnoki
50a5639a8b WriteValue should return undefined 2016-11-28 17:14:11 +01:00
Attila Dusnoki
d9c7ffb5b3 Add event target for bluetooth 2016-11-28 10:49:49 +01:00
Attila Dusnoki
fd7cdbf19f Add Start/Stop notifications 2016-11-23 01:24:33 -08:00
Zakor Gyula
f98fbecfda Rename blacklist to blocklist 2016-11-17 15:23:14 +01:00
Attila Dusnoki
e7e7c74c9e Webbluetooth Async behaviour 2016-11-08 13:27:56 +01:00
zakorgyula
e8c1c98a77 Return the same JS object for the same Bluetooth item. 2016-11-04 15:36:57 +01:00
fokinv
d30bcbd339 Blacklisted items are removed when calling getServices/Characteristics/Descriptors. 2016-11-04 15:36:55 +01:00
zakorgyula
dd733f6994 Update the value of the Characteristic/Descriptor when calling writeValue. 2016-11-04 15:36:50 +01:00
zakorgyula
b72dcf326b Check if the BluetoothDevice is connected, when calling getGATT functions. 2016-11-04 15:22:48 +01:00
Ms2ger
4fbe415e80 Split the bluetooth code out from the net crates. 2016-11-03 16:45:07 +01:00
Anthony Ramine
d8e92bb271 Rename Reflectable::global_scope to global 2016-10-06 21:36:41 +02:00
Anthony Ramine
d4fccbace4 Make bluetooth::result_to_promise take a &GlobalScope 2016-10-06 21:35:46 +02:00
Anthony Ramine
766010379e Introduce GlobalScope::as_window 2016-10-06 21:35:45 +02:00
Anthony Ramine
ae6af5172b Introduce Reflectable::global_scope 2016-10-06 21:35:38 +02:00
Anthony Ramine
fcb59d3057 Make reflect_dom_object take a &GlobalScope 2016-10-06 20:59:09 +02:00
Anthony Ramine
ffe712a103 Reorganise the BluetoothUUID utility functions 2016-10-02 23:06:33 +02:00
Mátyás Mustoha
e05a839d25 Update WebBluetooth to use Promises 2016-09-26 20:02:42 +02:00
Arthur Marble
5fa54177ca Refactored a bluetooth* related files from codeStyle to code_style. 2016-09-18 00:07:32 -05:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
bors-servo
45209b7ffe Auto merge of #12538 - szeged:error-refactor, r=nox
Refactor Bluetooth error handling

<!-- Please describe your changes on the following line: -->
Replace the error messages with an enum in `net/bluetooth_thread.rs`. Rename `bluetooth_blacklist.rs` to `bluetooth_utils.rs` and put the error conversion in it.
With this the returned errors in DOM classes follow the specification.
<!-- 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 is 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12538)
<!-- Reviewable:end -->
2016-07-28 03:33:08 -05:00
zakorgy
b4db14471b Refactor Bluetooth error handling 2016-07-27 15:02:01 +02:00
zakorgyula
2d2eb62fa0 WebBluetooth Specification Change 2016-07-26 14:29:23 +02:00
zakorgy
aaf21dab4f Remove some unnecessary pub modifiers (#50) 2016-07-14 10:35:06 +02:00
zakorgyula
2ab4511de8 Add missing steps to descriptors writeValue function 2016-07-07 10:07:15 +02:00
zakorgy
52e1d8325f Missing steps of Characteristic's readValue, writeValue functions 2016-07-06 09:31:52 +02:00
fokinv
a920e6d54e Add WebBluetooth Blacklist support 2016-05-31 17:05:45 +02:00