Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRemove compositor forwarding code and use dedicated mechanism #17269
Conversation
highfive
commented
Jun 11, 2017
|
Heads up! This PR modifies the following files:
|
e9c224a
to
88fa2fc
|
Can you add a change to ports/ to show how this endup being used? Maybe you could rewrite the title update mechanism (the title of the current page is displayed in the glutin window). |
|
Two examples where the compositor should not been involved:
|
|
|
|
@paulrouget I've just added a commit to support changing the page title, tested it locally and "it works". It doesn't require any changes in ports, however it does require reaching for the root pipeline inside the compositor. |
88657cf
to
b0ffab7
|
@paulrouget Ok now also added support for:
|
|
Initial review pass |
| pub enum EmbedderMsg { | ||
| /// A status message to be displayed by the browser chrome. | ||
| Status(Option<String>), | ||
| /// Alerts the compositor that the current page has changed its title. |
This comment has been minimized.
This comment has been minimized.
| @@ -30,6 +30,42 @@ pub trait EventLoopWaker : 'static + Send { | |||
| } | |||
|
|
|||
| /// Sends messages to the compositor. | |||
This comment has been minimized.
This comment has been minimized.
| } | ||
| } | ||
|
|
||
| /// The port that the compositor receives messages on. |
This comment has been minimized.
This comment has been minimized.
| @@ -171,6 +171,8 @@ pub struct Constellation<Message, LTF, STF> { | |||
| /// A channel for the constellation to receive messages from the compositor thread. | |||
| compositor_receiver: Receiver<FromCompositorMsg>, | |||
|
|
|||
| embedder_proxy: EmbedderProxy, | |||
This comment has been minimized.
This comment has been minimized.
| @@ -299,6 +301,8 @@ pub struct Constellation<Message, LTF, STF> { | |||
|
|
|||
| /// State needed to construct a constellation. | |||
| pub struct InitialConstellationState { | |||
| pub embedder_proxy: EmbedderProxy, | |||
This comment has been minimized.
This comment has been minimized.
| (EmbedderProxy { | ||
| sender: sender, | ||
| event_loop_waker: event_loop_waker, | ||
| }, |
This comment has been minimized.
This comment has been minimized.
| (_, _) => {}, | ||
| } | ||
| } | ||
| for event in events.clone() { |
This comment has been minimized.
This comment has been minimized.
cbrewster
Jun 13, 2017
Member
Since the variants of WindowEvent handled by the embedder and the compositor are disjoint, it would be better to have two separate types. Maybe the window should store events for the compositor and events for the embedder?
This comment has been minimized.
This comment has been minimized.
gterzian
Jun 13, 2017
•
Author
Member
Good point. I would almost be tempted to think that all window events should be handled by Browser, which could call the appropriate methods of compositor, or handle those differently(such as in the cases where the compositor isn't involved). Maybe this could also help support multiple compositors down the line? @paulrouget
So in other words, all window events could be handled here, and Browser could either call a method of 'window', or 'compositor', or both, in response to each event.
| fn handle_window_event(&mut self, event: WindowEvent) { | ||
| match event { | ||
| WindowEvent::Reload => { | ||
| let top_level_browsing_context_id = match self.compositor.root_pipeline { |
This comment has been minimized.
This comment has been minimized.
cbrewster
Jun 13, 2017
Member
Is the plan to eventually allow the embedder to handle the current top_level_browsing_context_id?
cc @paulrouget
This comment has been minimized.
This comment has been minimized.
paulrouget
Jun 13, 2017
Contributor
Eventually, the embedder will have a list of top_level_browsing_context_id (tabs).
This comment has been minimized.
This comment has been minimized.
paulrouget
Jun 13, 2017
Contributor
So asking the compositor for the root pipeline to get the context id will be be a temporary thing.
|
|
|
@cbrewster thanks for the review so far, I'm on standby for a bit more "big picture" guidance from @paulrouget... |
|
OK so I've done one more thing to just follow along the current line, and learned some stuff along the way:
My conclusion so far on this experiment:
|
01c4eaf
to
186139c
|
@paulrouget Ok just to continue the current experiment, I made an attempt to move all messages from constellation that don't relate to the compositor to the dedicated "embedder" channel, and I've also moved all window event handling from compositor to browser. I think the first part is the stated goal of this issue, and I'm wondering if we shouldn't include moving all window event handling as I did as well. Worth noting is that the way the compositor was previously handling it's "own" messages, as well as window events, was intertwined with the When I run servo, I keep getting a Also when I tried to run some tests, it seemed very slow, and I'm not sure if it's just my machine or if I introduce something that slows down the event loop or something else... (note: the PR still contains debug messages). |
|
@gterzian your work and my work may conflict. It's work in progress, but you might want to take a look: master...paulrouget:attach-pipeline-wip |
|
@paulrouget There will defenitely be a huge "conflict" in terms of git |
|
|
d4e1022
to
e79db2e
|
@bors-servo: retry |
|
|
|
|
|
Same error multiple times in a row. What does it mean?
|
|
@bors-servo retry |
…_use_dedicated_mechanism, r=asajeffrey Remove compositor forwarding code and use dedicated mechanism <!-- Please describe your changes on the following line: --> @paulrouget Here is a first sketch of the proposed "design", handling a first message as a proof of concept, if you could please already take a look before I move all the messages(or method calls) across... thanks --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #15934 (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/17269) <!-- Reviewable:end -->
|
|
|
@bors-servo: retry |
…_use_dedicated_mechanism, r=asajeffrey Remove compositor forwarding code and use dedicated mechanism <!-- Please describe your changes on the following line: --> @paulrouget Here is a first sketch of the proposed "design", handling a first message as a proof of concept, if you could please already take a look before I move all the messages(or method calls) across... thanks --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #15934 (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/17269) <!-- Reviewable:end -->
|
|
|
Thank you all for your help. |
gterzian commentedJun 11, 2017
•
edited
@paulrouget Here is a first sketch of the proposed "design", handling a first message as a proof of concept, if you could please already take a look before I move all the messages(or method calls) across... thanks
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is