Skip to content

refactor(bluetooth): removes direct ui invocation from bluetooth thread - #20578

Merged
bors-servo merged 7 commits into
servo:masterfrom
kwonoj:refactor-bluetooth-manager
Apr 19, 2018
Merged

bors-servo merged 7 commits into
servo:masterfrom
kwonoj:refactor-bluetooth-manager

Conversation

@kwonoj

@kwonoj kwonoj commented Apr 6, 2018 •

Copy link
Copy Markdown
Contributor

Relates to #20429.

This PR is mostly blocked by #20480, cause both are nearly identical change in crux and based on review of prior changes this PR need to be updated. Just didn't want assigned issue hanging without visible progresses, so prepped PR to followup further.

(mostly copy-paste from pair PR)

Probably point of review / need to be updated are

  1. Communication between components
    Currently it's wired as like below:
+----------------+                    +---------------+              +---------+
|                |  constellationMsg  |               | embedderMsg  |         |
| bluetooth_thread +----------------->+ constellation +------------->+ browser |
|                |                    |               |              |         |
+-----+----------+                    +---------------+              +----+----+
      ^                                                                   |
      +-------------------------------------------------------------------+
                                device: String
  • is this feasible approach?
  • does organization of message / fn (where to put consteallation / embedder msg & fns) are legit?
  1. Invoking tfd in a separate thread
  • This was mainly to align behavior to previous implentation, where tfd was invoked inside of filemanager_thread so does not block main. It may possibly just let block instead.

and of course, a lot of other codes need to follow better practices.


  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive

highfive commented Apr 6, 2018

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @asajeffrey: components/constellation/constellation.rs
  • @cbrewster: components/constellation/constellation.rs
  • @paulrouget: ports/servo/browser.rs, components/constellation/constellation.rs, components/servo/lib.rs, components/compositing/compositor_thread.rs
  • @fitzgen: components/script_traits/script_msg.rs, components/script_traits/lib.rs
  • @KiChjang: components/script_traits/script_msg.rs, components/script_traits/lib.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 6, 2018
@kwonoj
kwonoj force-pushed the refactor-bluetooth-manager branch 2 times, most recently from 014d1b0 to 0ef41bc Compare April 9, 2018 14:24
@paulrouget

Copy link
Copy Markdown
Contributor

I'll look at this after we agreed on what needs to be done with PR #20480.

@kwonoj
kwonoj force-pushed the refactor-bluetooth-manager branch 2 times, most recently from 0fa415a to 0df7ea4 Compare April 18, 2018 02:48
return Some(address);
}
}
return None;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching, this looks mistake I made while integrate flows of select_device function in bluethooth thread. Updated PR to revert changes.

@paulrouget

Copy link
Copy Markdown
Contributor

@bors-servo delegate+

Please juste explain why we don't bail early if we use a mock.

@bors-servo

Copy link
Copy Markdown
Contributor

✌️ @kwonoj can now approve this pull request

@kwonoj
kwonoj force-pushed the refactor-bluetooth-manager branch from 0df7ea4 to 683cef5 Compare April 18, 2018 06:49
@kwonoj

kwonoj commented Apr 18, 2018

Copy link
Copy Markdown
Contributor Author

Please juste explain why we don't bail early if we use a mock.

Left explanation #20578 (comment), basically accidental changes while refactoring flows. PR's updated, will try to check in changes once CI says green.

@kwonoj

kwonoj commented Apr 18, 2018

Copy link
Copy Markdown
Contributor Author

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 683cef5 has been approved by kwonoj

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 18, 2018
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 683cef5 with merge 38ea48e...

bors-servo pushed a commit that referenced this pull request Apr 18, 2018
refactor(bluetooth): removes direct ui invocation from bluetooth thread

<!-- Please describe your changes on the following line: -->
Relates to #20429.

This PR is mostly blocked by #20480, cause both are nearly identical change in crux and based on review of prior changes this PR need to be updated. Just didn't want assigned issue hanging without visible progresses, so prepped PR to followup further.

(mostly copy-paste from pair PR)

Probably point of review / need to be updated are

1. Communication between components
Currently it's wired as like below:
```
+----------------+                    +---------------+              +---------+
|                |  constellationMsg  |               | embedderMsg  |         |
| bluetooth_thread +----------------->+ constellation +------------->+ browser |
|                |                    |               |              |         |
+-----+----------+                    +---------------+              +----+----+
      ^                                                                   |
      +-------------------------------------------------------------------+
                                device: String
```
- is this feasible approach?
- does organization of message / fn (where to put consteallation / embedder msg & fns) are legit?

2. Invoking tfd in a separate thread
- This was mainly to align behavior to previous implentation, where tfd was invoked inside of filemanager_thread so does not block main. It may possibly just let block instead.

and of course, a lot of other codes need to follow better practices.

---
<!-- 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
- [ ] `./mach build-geckolib` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #20429 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/20578)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-css1

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Apr 18, 2018
@kwonoj

kwonoj commented Apr 18, 2018

Copy link
Copy Markdown
Contributor Author

@bors-servo retry

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 683cef5 with merge 94b6b02...

bors-servo pushed a commit that referenced this pull request Apr 18, 2018
refactor(bluetooth): removes direct ui invocation from bluetooth thread

<!-- Please describe your changes on the following line: -->
Relates to #20429.

This PR is mostly blocked by #20480, cause both are nearly identical change in crux and based on review of prior changes this PR need to be updated. Just didn't want assigned issue hanging without visible progresses, so prepped PR to followup further.

(mostly copy-paste from pair PR)

Probably point of review / need to be updated are

1. Communication between components
Currently it's wired as like below:
```
+----------------+                    +---------------+              +---------+
|                |  constellationMsg  |               | embedderMsg  |         |
| bluetooth_thread +----------------->+ constellation +------------->+ browser |
|                |                    |               |              |         |
+-----+----------+                    +---------------+              +----+----+
      ^                                                                   |
      +-------------------------------------------------------------------+
                                device: String
```
- is this feasible approach?
- does organization of message / fn (where to put consteallation / embedder msg & fns) are legit?

2. Invoking tfd in a separate thread
- This was mainly to align behavior to previous implentation, where tfd was invoked inside of filemanager_thread so does not block main. It may possibly just let block instead.

and of course, a lot of other codes need to follow better practices.

---
<!-- 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
- [ ] `./mach build-geckolib` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #20429 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/20578)
<!-- Reviewable:end -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Apr 18, 2018
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-wpt3

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Apr 18, 2018
@kwonoj
kwonoj force-pushed the refactor-bluetooth-manager branch from 683cef5 to 61b4a89 Compare April 18, 2018 18:39
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Apr 18, 2018
@kwonoj

kwonoj commented Apr 19, 2018

Copy link
Copy Markdown
Contributor Author

@bors-servo retry

@paulrouget

Copy link
Copy Markdown
Contributor

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 61b4a89 has been approved by paulrouget

@highfive highfive assigned paulrouget and unassigned emilio Apr 19, 2018
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 19, 2018
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 61b4a89 with merge 8d64169...

bors-servo pushed a commit that referenced this pull request Apr 19, 2018
refactor(bluetooth): removes direct ui invocation from bluetooth thread

<!-- Please describe your changes on the following line: -->
Relates to #20429.

This PR is mostly blocked by #20480, cause both are nearly identical change in crux and based on review of prior changes this PR need to be updated. Just didn't want assigned issue hanging without visible progresses, so prepped PR to followup further.

(mostly copy-paste from pair PR)

Probably point of review / need to be updated are

1. Communication between components
Currently it's wired as like below:
```
+----------------+                    +---------------+              +---------+
|                |  constellationMsg  |               | embedderMsg  |         |
| bluetooth_thread +----------------->+ constellation +------------->+ browser |
|                |                    |               |              |         |
+-----+----------+                    +---------------+              +----+----+
      ^                                                                   |
      +-------------------------------------------------------------------+
                                device: String
```
- is this feasible approach?
- does organization of message / fn (where to put consteallation / embedder msg & fns) are legit?

2. Invoking tfd in a separate thread
- This was mainly to align behavior to previous implentation, where tfd was invoked inside of filemanager_thread so does not block main. It may possibly just let block instead.

and of course, a lot of other codes need to follow better practices.

---
<!-- 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
- [ ] `./mach build-geckolib` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #20429 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/20578)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-wpt3

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Apr 19, 2018
@kwonoj

kwonoj commented Apr 19, 2018

Copy link
Copy Markdown
Contributor Author

command timed out: 1200 seconds without output running ['git', 'fetch', '-t', 'https://github.com/servo/servo', 'auto'], attempting to kill
process killed by signal 9

I tried a couple of times and mac-rel-wpt3 keep failing with fetching repo, not sure what could cause the same failure in a row.

@paulrouget

Copy link
Copy Markdown
Contributor

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 61b4a89 with merge 319de3b...

bors-servo pushed a commit that referenced this pull request Apr 19, 2018
refactor(bluetooth): removes direct ui invocation from bluetooth thread

<!-- Please describe your changes on the following line: -->
Relates to #20429.

This PR is mostly blocked by #20480, cause both are nearly identical change in crux and based on review of prior changes this PR need to be updated. Just didn't want assigned issue hanging without visible progresses, so prepped PR to followup further.

(mostly copy-paste from pair PR)

Probably point of review / need to be updated are

1. Communication between components
Currently it's wired as like below:
```
+----------------+                    +---------------+              +---------+
|                |  constellationMsg  |               | embedderMsg  |         |
| bluetooth_thread +----------------->+ constellation +------------->+ browser |
|                |                    |               |              |         |
+-----+----------+                    +---------------+              +----+----+
      ^                                                                   |
      +-------------------------------------------------------------------+
                                device: String
```
- is this feasible approach?
- does organization of message / fn (where to put consteallation / embedder msg & fns) are legit?

2. Invoking tfd in a separate thread
- This was mainly to align behavior to previous implentation, where tfd was invoked inside of filemanager_thread so does not block main. It may possibly just let block instead.

and of course, a lot of other codes need to follow better practices.

---
<!-- 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
- [ ] `./mach build-geckolib` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #20429 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/20578)
<!-- Reviewable:end -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Apr 19, 2018
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev
Approved by: paulrouget
Pushing 319de3b to master...

@bors-servo
bors-servo merged commit 61b4a89 into servo:master Apr 19, 2018
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 19, 2018
@kwonoj
kwonoj deleted the refactor-bluetooth-manager branch April 21, 2018 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove use of tinyfiledialogs from bluetooth code

5 participants