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 upPipeline always stores frame #13627
Pipeline always stores frame #13627
Conversation
highfive
commented
Oct 6, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
Oct 6, 2016
|
The first commit is from #13498, and isn't really part of this PR. |
|
cc @paulrouget were you still interested in having pipelines that are detached from |
That used to be a thing, but no, not anymore. I see no problem with this PR. |
|
|
9d0ed77
to
e47a2ff
|
|
e47a2ff
to
8ca1cec
|
#13498 has now landed, so this can now merge. r? @ConnorGBrewster |
|
Looks good, except my one comment. Not 100% sure what to do in that case right now. |
| @@ -2007,7 +2008,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> | |||
| // a dependent pipeline to be ready to paint. | |||
| while let Some(valid_frame_change) = self.pending_frames.iter().rposition(|frame_change| { | |||
| let waiting_on_dependency = frame_change.old_pipeline_id.map_or(false, |old_pipeline_id| { | |||
| self.pipelines.get(&old_pipeline_id).map(|pipeline| pipeline.frame).is_none() | |||
| self.pipelines.get(&old_pipeline_id).and_then(|pipeline| self.frames.get(&pipeline.frame_id)).is_none() | |||
This comment has been minimized.
This comment has been minimized.
cbrewster
Oct 9, 2016
Member
I don't believe this is equivalent to what we had before. Before, if frame is None, it means that the pipeline has not matured yet. In this change it is checking if the Frame exists. I think this will actually be ok, just because I am not sure if we ever have a scenario where one pending frame change is waiting on another.
This comment has been minimized.
This comment has been minimized.
asajeffrey
Oct 10, 2016
Author
Member
I could add a is_mature flag to Pipeline, to capture the case where the frame id was None.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Looks good to me except possibly 1 nit. Squash and r=me |
| @@ -663,6 +663,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> | |||
| assert!(self.pipelines.get(&pipeline_id).map(|pipeline| pipeline.frame_id == frame_id).unwrap_or(false)); | |||
| assert!(!self.frames.contains_key(&frame_id)); | |||
|
|
|||
| self.pipelines.get_mut(&pipeline_id).map(|pipeline| pipeline.is_mature = true); | |||
This comment has been minimized.
This comment has been minimized.
cbrewster
Oct 10, 2016
Member
nit: should we use if let here instead of map since we are changing state.
This comment has been minimized.
This comment has been minimized.
asajeffrey
Oct 10, 2016
Author
Member
Fixed. I think we should also get rid of those assertions, as they are potential sources of panic in the constellation.
1da8b65
to
c7c45ce
|
Squashed, @bors-servo r=ConnorGBrewster |
|
|
…ConnorGBrewster Pipeline always stores frame <!-- Please describe your changes on the following line: --> This change makes the pipeline always store the frame id, not just optionally. This is the first part of a long slog to use FrameIds rather than PipelineIds to identify frames. cc @ConnorGBrewster --- <!-- 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 refactoring <!-- 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/13627) <!-- Reviewable:end -->
|
|
highfive
commented
Oct 10, 2016
|
c7c45ce
to
eef02dd
|
Fixed a case where |
|
|
…ConnorGBrewster Pipeline always stores frame <!-- Please describe your changes on the following line: --> This change makes the pipeline always store the frame id, not just optionally. This is the first part of a long slog to use FrameIds rather than PipelineIds to identify frames. cc @ConnorGBrewster --- <!-- 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 refactoring <!-- 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/13627) <!-- Reviewable:end -->
|
|
asajeffrey commentedOct 6, 2016
•
edited by larsbergstrom
This change makes the pipeline always store the frame id, not just optionally. This is the first part of a long slog to use FrameIds rather than PipelineIds to identify frames. cc @ConnorGBrewster
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is