Conversation
|
Heads up! This PR modifies the following files:
|
|
@jdm r? |
jdm
left a comment
There was a problem hiding this comment.
Great work! It's exciting to see all of this synchronous code become asynchronous.
components/script/dom/bluetooth.rs
Outdated
| })); | ||
| let listener = NetworkListener { | ||
| context: context, | ||
| //script_chan: receiver.root().global().r().networking_task_source(), |
components/script/dom/bluetooth.rs
Outdated
| } | ||
|
|
||
| pub fn response_async<T: AsyncBluetoothListener + Reflectable + 'static>( | ||
| //chan: Box<ScriptChan + Send>, |
components/script/dom/bluetooth.rs
Outdated
| pub fn response_async<T: AsyncBluetoothListener + Reflectable + 'static>( | ||
| //chan: Box<ScriptChan + Send>, | ||
| promise: &Rc<Promise>, | ||
| receiver: Trusted<T>) -> IpcSender<BluetoothResponseMsg> { |
There was a problem hiding this comment.
It would make more sense to take a &T argument and store the result of Trusted::new(receiver) instead.
| RequestDevice(BluetoothDeviceMsg), | ||
| GATTServerConnect(bool), | ||
| GATTServerDisconnect(bool), | ||
| //GATTServerDisconnect(bool), |
| pub enum BluetoothResponse { | ||
| RequestDevice(BluetoothDeviceMsg), | ||
| GATTServerConnect(bool), | ||
| RequestDevice(BluetoothResult<BluetoothDeviceMsg>), |
There was a problem hiding this comment.
Given that every response includes a result value, it probably makes more sense to use BluetoothResult<BluetoothResponse> instead. This will mean less code duplication for handling errors in places like bluetoothremotegattcharacteristic.rs. It could even be handled inside BluetoothResponseListener::response, so none of the rest of the implementations of AsyncBluetoothListener need to care about errors.
|
The changes in e550880 are a good improvement. There are still a couple unaddressed comments from my last review, too. |
|
The last thing on my list is to remove the any idea how should i do it? |
|
You're right, I looked at the code and I don't see a way to make that change right now. It's fine as-is. |
|
Note: There was a commit which moved bluetooth to a new folder, and |
|
@bors-servo: r+ |
|
📌 Commit d9e1cf3 has been approved by |
Webbluetooth Async behaviour <!-- Please describe your changes on the following line: --> Note: depends on #13612 The current WBT communication is synchronous. With this, it should work properly (except the disconnect function, which will need some more work, because the current implementation differ from the spec). <!-- 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/13909) <!-- Reviewable:end -->
|
💔 Test failed - linux-dev |
|
oh.. i forget the ports.. :/ |
|
@bors-servo: r+ |
|
📌 Commit a18490b has been approved by |
|
🔒 Merge conflict |
|
☔ The latest upstream changes (presumably #13918) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@bors-servo: r+ |
|
📌 Commit e7e7c74 has been approved by |
|
⌛ Testing commit e7e7c74 with merge 1153ca9... |
Webbluetooth Async behaviour <!-- Please describe your changes on the following line: --> Note: depends on #13612 The current WBT communication is synchronous. With this, it should work properly (except the disconnect function, which will need some more work, because the current implementation differ from the spec). <!-- 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/13909) <!-- Reviewable:end -->
|
☀️ Test successful - arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-dev |
Note: depends on #13612
The current WBT communication is synchronous. With this, it should work properly (except the disconnect function, which will need some more work, because the current implementation differ from the spec).
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is