Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1103)

Unified Diff: content/renderer/render_frame_impl.cc

Issue 694963003: Revert of Clean up the page state saving mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/test/render_view_test.cc ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 151b545987cda0a5fab4246677e1a3bf1f54b080..3ba2cb5dc10cab68a4416861be40045f7ab53a70 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -1098,8 +1098,8 @@
// clearing the page. We also allow this process to exit if there are no
// other active RenderFrames in it.
- // Send any pending page state messages before we get swapped out.
- render_view_->FlushPageState();
+ // Send an UpdateState message before we get swapped out.
+ render_view_->SyncNavigationState();
// If we need a proxy to replace this, create it now so its routing id is
// registered for receiving IPC messages.
@@ -2253,9 +2253,9 @@
}
// When we perform a new navigation, we need to update the last committed
- // session history entry with any dirty page state for the page we are
- // leaving. Do this before updating the HistoryController state.
- render_view_->FlushPageState();
+ // session history entry with state for the page we are leaving. Do this
+ // before updating the HistoryController state.
+ render_view_->UpdateSessionHistory(frame);
render_view_->history_controller()->UpdateForCommit(this, item, commit_type,
navigation_state->was_within_same_page());
@@ -2277,12 +2277,12 @@
// We bump our Page ID to correspond with the new session history entry.
render_view_->page_id_ = render_view_->next_page_id_++;
- // Don't update history_page_ids_ (etc) for kSwappedOutURL, since we don't
- // want to forget the entry that was there, and since we will never come
- // back to kSwappedOutURL. Note that we have to call FlushPageState and
- // update page_id_ even in this case, so that the current entry gets a state
- // update and so that we don't send a state update to the wrong entry when
- // we swap back in.
+ // Don't update history_page_ids_ (etc) for kSwappedOutURL, since
+ // we don't want to forget the entry that was there, and since we will
+ // never come back to kSwappedOutURL. Note that we have to call
+ // UpdateSessionHistory and update page_id_ even in this case, so that
+ // the current entry gets a state update and so that we don't send a
+ // state update to the wrong entry when we swap back in.
if (GetLoadingUrl() != GURL(kSwappedOutURL)) {
// Advance our offset in session history, applying the length limit.
// There is now no forward history.
@@ -2305,8 +2305,8 @@
// per navigation.
//
// Note that we need to check if the page ID changed. In the case of a
- // reload, the page ID doesn't change, and FlushPageState gets the previous
- // URL and the current page ID, which would be wrong.
+ // reload, the page ID doesn't change, and UpdateSessionHistory gets the
+ // previous URL and the current page ID, which would be wrong.
if (navigation_state->pending_page_id() != -1 &&
navigation_state->pending_page_id() != render_view_->page_id_ &&
!navigation_state->request_committed()) {
« no previous file with comments | « content/public/test/render_view_test.cc ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698