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

Frames in the constellation store LoadData rather than just URLs. #15878

Merged

Conversation

@asajeffrey
Copy link
Member

asajeffrey commented Mar 9, 2017

Include LoadData in each session history entry, so that when we reload discarded documents we can include POST data etc.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #14888
  • These changes do not require tests because we don't test document discarding.

This change is Reviewable

@asajeffrey
Copy link
Member Author

asajeffrey commented Mar 9, 2017

@highfive highfive assigned cbrewster and unassigned Manishearth Mar 9, 2017
Copy link
Member

cbrewster left a comment

Looks good other than a couple nits

@@ -81,7 +80,7 @@ impl Frame {
pub fn update_current(&mut self, pipeline_id: PipelineId, entry: &FrameState) {
self.pipeline_id = pipeline_id;
self.instant = entry.instant;
self.url = entry.url.clone();
self.load_data = entry.load_data.clone();

This comment has been minimized.

Copy link
@cbrewster

cbrewster Mar 12, 2017

Member

We should make update_current take ownership of entry to remove this clone.

This comment has been minimized.

Copy link
@asajeffrey

asajeffrey Mar 14, 2017

Author Member

Done.

self.traverse_to_entry(entry);
(evicted_id, false, None, false)
(None, false, None, false)

This comment has been minimized.

Copy link
@cbrewster

cbrewster Mar 12, 2017

Member

Now that only one branch returns something other than None for evicted_id can we just move close_pipeline inside the only branch that uses it?

This comment has been minimized.

Copy link
@asajeffrey

asajeffrey Mar 14, 2017

Author Member

Afraid not:

error[E0499]: cannot borrow `*self` as mutable more than once at a time
    --> /home/ajeffrey/github/asajeffrey/servo/components/constellation/constellation.rs:2165:17
     |
2156 |         } else if let Some(frame) = self.frames.get_mut(&frame_change.frame_id) {
     |                                     ----------- first mutable borrow occurs here
...
2165 |                 self.close_pipeline(evicted_id, DiscardBrowsingContext::No, ExitPipelineMode::Normal);
     |                 ^^^^ second mutable borrow occurs here
...
2171 |         };
     |         - first borrow ends here

This comment has been minimized.

Copy link
@cbrewster

This comment has been minimized.

Copy link
@asajeffrey

asajeffrey Mar 14, 2017

Author Member

Indeed. Is it still r=you?

This comment has been minimized.

Copy link
@KiChjang

KiChjang Mar 14, 2017

Member

Makes me want to have 2-phase borrowing here...

This comment has been minimized.

Copy link
@asajeffrey

asajeffrey Mar 14, 2017

Author Member

Indeed.

@asajeffrey asajeffrey force-pushed the asajeffrey:constellation-frames-store-loaddata branch from 7cbd54c to 90650da Mar 14, 2017

/// Is the new document replacing the current document (e.g. a reload)
/// or pushing it into the session history (e.g. a navigation)?
pub replace: Option<FrameState>,
/// It it replacing an existing entry, we store its timestamp.

This comment has been minimized.

Copy link
@cbrewster

cbrewster Mar 14, 2017

Member

s/It it/If it is/

This comment has been minimized.

Copy link
@asajeffrey

asajeffrey Mar 14, 2017

Author Member

Fixed.

@asajeffrey asajeffrey force-pushed the asajeffrey:constellation-frames-store-loaddata branch from 90650da to 1a44a76 Mar 14, 2017
@asajeffrey
Copy link
Member Author

asajeffrey commented Mar 14, 2017

@bors-servo r=cbrewster

@bors-servo
Copy link
Contributor

bors-servo commented Mar 14, 2017

📌 Commit 1a44a76 has been approved by cbrewster

@bors-servo
Copy link
Contributor

bors-servo commented Mar 14, 2017

Testing commit 1a44a76 with merge 569d51d...

bors-servo added a commit that referenced this pull request Mar 14, 2017
…, r=cbrewster

Frames in the constellation store LoadData rather than just URLs.

<!-- Please describe your changes on the following line: -->

Include LoadData in each session history entry, so that when we reload discarded documents we can include POST data etc.

---
<!-- 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 fix #14888
- [X] These changes do not require tests because we don't test document discarding.

<!-- 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/15878)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Mar 14, 2017

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-gnu-dev, windows-msvc-dev
Approved by: cbrewster
Pushing 569d51d to master...

@bors-servo bors-servo merged commit 1a44a76 into servo:master Mar 14, 2017
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
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.

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