Skip to content

Pipeline always stores frame#13627

Merged
bors-servo merged 1 commit intoservo:masterfrom
asajeffrey:pipeline-always-stores-frame-id
Oct 10, 2016
Merged

Pipeline always stores frame#13627
bors-servo merged 1 commit intoservo:masterfrom
asajeffrey:pipeline-always-stores-frame-id

Conversation

@asajeffrey
Copy link
Copy Markdown
Contributor

@asajeffrey asajeffrey commented Oct 6, 2016

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 -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes do not require tests because refactoring

This change is Reviewable

@asajeffrey asajeffrey added I-refactor No impact; the issue is one of maintainability or tidiness. Proposed solution requires refactoring. A-constellation Involves the constellation labels Oct 6, 2016
@highfive
Copy link
Copy Markdown

highfive commented Oct 6, 2016

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/htmliframeelement.rs, components/script/dom/bindings/trace.rs, components/script_traits/lib.rs, components/script_traits/lib.rs

@highfive
Copy link
Copy Markdown

highfive commented Oct 6, 2016

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 6, 2016
@asajeffrey
Copy link
Copy Markdown
Contributor Author

The first commit is from #13498, and isn't really part of this PR.

@cbrewster
Copy link
Copy Markdown
Contributor

cc @paulrouget were you still interested in having pipelines that are detached from Frames?

@paulrouget
Copy link
Copy Markdown
Contributor

@paulrouget were you still interested in having pipelines that are detached from Frames?

That used to be a thing, but no, not anymore.

I see no problem with this PR.

@bors-servo
Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #13596) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Oct 7, 2016
@asajeffrey asajeffrey force-pushed the pipeline-always-stores-frame-id branch from 9d0ed77 to e47a2ff Compare October 7, 2016 17:09
@bors-servo
Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #13498) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Oct 7, 2016
@asajeffrey asajeffrey force-pushed the pipeline-always-stores-frame-id branch from e47a2ff to 8ca1cec Compare October 7, 2016 21:50
@asajeffrey
Copy link
Copy Markdown
Contributor Author

#13498 has now landed, so this can now merge. r? @ConnorGBrewster

@highfive highfive assigned cbrewster and unassigned larsbergstrom Oct 7, 2016
@asajeffrey asajeffrey mentioned this pull request Oct 7, 2016
3 tasks
Copy link
Copy Markdown
Contributor

@cbrewster cbrewster left a comment

Choose a reason for hiding this comment

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

Looks good, except my one comment. Not 100% sure what to do in that case right now.

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()
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.

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.

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.

I could add a is_mature flag to Pipeline, to capture the case where the frame id was 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.

Let's do that!

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.

Done.

@cbrewster cbrewster added S-awaiting-answer Someone asked a question that requires an answer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 9, 2016
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 10, 2016
Copy link
Copy Markdown
Contributor

@cbrewster cbrewster left a comment

Choose a reason for hiding this comment

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

Looks good to me except possibly 1 nit.

Squash and r=me

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);
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.

nit: should we use if let here instead of map since we are changing state.

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.

Fixed. I think we should also get rid of those assertions, as they are potential sources of panic in the constellation.

@cbrewster cbrewster added S-needs-squash Some (or all) of the commits in the PR should be combined. and removed S-awaiting-answer Someone asked a question that requires an answer. S-awaiting-review There is new code that needs to be reviewed. S-needs-rebase There are merge conflict errors. labels Oct 10, 2016
@asajeffrey asajeffrey force-pushed the pipeline-always-stores-frame-id branch from 1da8b65 to c7c45ce Compare October 10, 2016 17:10
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 10, 2016
@asajeffrey
Copy link
Copy Markdown
Contributor Author

Squashed, @bors-servo r=ConnorGBrewster

@bors-servo
Copy link
Copy Markdown
Contributor

📌 Commit c7c45ce has been approved by ConnorGBrewster

@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. S-needs-squash Some (or all) of the commits in the PR should be combined. labels Oct 10, 2016
@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Testing commit c7c45ce with merge d175d63...

bors-servo pushed a commit that referenced this pull request Oct 10, 2016
…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 -->
@bors-servo
Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel-wpt

@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 Oct 10, 2016
@highfive
Copy link
Copy Markdown

  ▶ Unexpected subtest result in /html/browsers/history/joint-session-history/joint-session-history-only-fully-active.html:
  └ PASS [expected FAIL] Do only fully active documents count for session history?

  ▶ TIMEOUT [expected OK] /_mozilla/mozilla/mozbrowser/mozbrowserlocationchange_event.html
  │ 
  │ VMware, Inc.
  │ Gallium 0.4 on softpipe
  └ 3.3 (Core Profile) Mesa 12.0.1

  ▶ Unexpected subtest result in /_mozilla/mozilla/mozbrowser/mozbr</span><span class="stdout">owserlocationchange_event.html:
  │ TIMEOUT [expected PASS] Browser API; mozbrowserlocationchange event
  └   → Test timed out

@asajeffrey asajeffrey force-pushed the pipeline-always-stores-frame-id branch from c7c45ce to eef02dd Compare October 10, 2016 18:59
@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 Oct 10, 2016
@asajeffrey
Copy link
Copy Markdown
Contributor Author

Fixed a case where is_mature wasn't being set properly. @bors-servo r=ConnorGBrewster via irc.

@bors-servo
Copy link
Copy Markdown
Contributor

📌 Commit eef02dd has been approved by ConnorGBrewster

@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 Oct 10, 2016
@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Testing commit eef02dd with merge 51b806f...

bors-servo pushed a commit that referenced this pull request Oct 10, 2016
…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 -->
@bors-servo
Copy link
Copy Markdown
Contributor

@bors-servo bors-servo merged commit eef02dd into servo:master Oct 10, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-constellation Involves the constellation I-refactor No impact; the issue is one of maintainability or tidiness. Proposed solution requires refactoring.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants