Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if represented attributes are cached #14567

Merged
merged 1 commit into from Dec 15, 2016

Conversation

@zakorgy
Copy link
Contributor

zakorgy commented Dec 13, 2016

Improve existing cache checks in /bluetooth/lib.rs, and update Step comments in script/dom corresponding to this.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • There are tests for these changes OR

This change is Reviewable

@highfive
Copy link

highfive commented Dec 13, 2016

Heads up! This PR modifies the following files:

  • @fitzgen: components/script/dom/bluetoothremotegattserver.rs, components/script/dom/bluetoothremotegattservice.rs, components/script/dom/bluetoothremotegattdescriptor.rs, components/script/dom/bluetoothremotegattcharacteristic.rs
  • @KiChjang: components/script/dom/bluetoothremotegattserver.rs, components/script/dom/bluetoothremotegattservice.rs, components/script/dom/bluetoothremotegattdescriptor.rs, components/script/dom/bluetoothremotegattcharacteristic.rs
@zakorgy
Copy link
Contributor Author

zakorgy commented Dec 13, 2016

r? @jdm

@highfive highfive assigned jdm and unassigned mbrubeck Dec 13, 2016
Copy link
Member

jdm left a comment

This looks fine, but I'd like to reduce the duplicated code that's being added.

@@ -627,6 +627,10 @@ impl BluetoothManager {

// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-connect
fn gatt_server_connect(&mut self, device_id: String, sender: IpcSender<BluetoothResponseResult>) {
// Step 2.
if !self.cached_devices.contains_key(&device_id) || !self.address_to_id.values().any(|v| v == &device_id) {

This comment has been minimized.

@jdm

jdm Dec 14, 2016

Member

Can we make this a device_is_cached helper method?

@@ -766,7 +770,7 @@ impl BluetoothManager {
uuid: String,
sender: IpcSender<BluetoothResponseResult>) {
// Step 5.
if !self.cached_services.contains_key(&service_id) {
if !self.cached_services.contains_key(&service_id) || !self.service_to_device.contains_key(&service_id) {

This comment has been minimized.

@jdm

jdm Dec 14, 2016

Member

Can we make this a service_is_cached helper method?

@@ -938,7 +942,8 @@ impl BluetoothManager {
uuid: String,
sender: IpcSender<BluetoothResponseResult>) {
// Step 5.
if !self.cached_characteristics.contains_key(&characteristic_id) {
if !self.cached_characteristics.contains_key(&characteristic_id) ||
!self.characteristic_to_service.contains_key(&characteristic_id) {

This comment has been minimized.

@jdm

jdm Dec 14, 2016

Member

Can we make this a characteristic_is_cached helper method?

@dati91 dati91 mentioned this pull request Dec 14, 2016
3 of 3 tasks complete
@jdm
Copy link
Member

jdm commented Dec 14, 2016

@bors-servo: delegate=dati91
Squash and r=jdm

@bors-servo
Copy link
Contributor

bors-servo commented Dec 14, 2016

✌️ @dati91 can now approve this pull request

@dati91 dati91 force-pushed the szeged:represented-attributes branch from d7f96cb to c3e7712 Dec 14, 2016
@dati91
Copy link
Contributor

dati91 commented Dec 14, 2016

@bors-servo r=jdm

@bors-servo
Copy link
Contributor

bors-servo commented Dec 14, 2016

📌 Commit c3e7712 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Dec 14, 2016

Testing commit c3e7712 with merge 6ee175b...

bors-servo added a commit that referenced this pull request Dec 14, 2016
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 -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 15, 2016

@bors-servo bors-servo merged commit c3e7712 into servo:master Dec 15, 2016
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.