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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 281653003: DRAFT CL: Add FrameNavigationEntry and track subframe session histories. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 5 years, 9 months 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/renderer/render_frame_impl.h ('k') | content/renderer/render_frame_proxy.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 88c7bd484e73f951f3597186b903a13e85e4cf77..8a915371ebeb4e393e6d294e07dc9e336cb3447a 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -1128,7 +1128,21 @@ void RenderFrameImpl::OnNavigate(
// Ensure we didn't save the swapped out URL in UpdateState, since the
// browser should never be telling us to navigate to swappedout://.
CHECK(entry->root().urlString() != WebString::fromUTF8(kSwappedOutURL));
- render_view_->history_controller()->GoToEntry(entry.Pass(), cache_policy);
+
+ // TODO(creis): Remove this HistoryEntry hack. We need it to find the
+ // frame sequence number when swapping a remote frame back to local.
+ RenderFrameProxy* proxy =
+ RenderFrameProxy::FromRoutingID(proxy_routing_id_);
+ if (proxy)
+ HistoryEntry::UpdateFrameMap(proxy_routing_id_, routing_id_);
+
+ // TODO(creis): Same vs different document load.
+ // TODO(creis): Change PageState to FrameState. In the meantime, we store
+ // the relevant frame's HistoryItem in the root of the PageState.
+ blink::WebHistoryItem history_item = entry->root();
+ frame->loadHistoryItem(history_item,
+ blink::WebHistoryDifferentDocumentLoad,
+ cache_policy);
}
} else if (!common_params.base_url_for_data_url.is_empty()) {
LoadDataURL(common_params, frame);
@@ -1299,6 +1313,8 @@ void RenderFrameImpl::OnSwapOut(
if (proxy) {
if (!is_main_frame) {
frame_->swap(proxy->web_frame());
+ // TODO(creis): Remove this HistoryEntry hack.
+ HistoryEntry::UpdateFrameMap(routing_id_, proxy_routing_id);
if (is_loading)
proxy->OnDidStartLoading();
@@ -2535,7 +2551,9 @@ void RenderFrameImpl::didCommitProvisionalLoad(
bool is_new_navigation = commit_type == blink::WebStandardCommit;
if (is_new_navigation) {
// We bump our Page ID to correspond with the new session history entry.
- render_view_->page_id_ = render_view_->next_page_id_++;
+ // TODO(creis): Update this.
+ //render_view_->page_id_ = render_view_->next_page_id_++;
+ render_view_->page_id_ = -1;
// Don't update history list values for kSwappedOutURL, since
// we don't want to forget the entry that was there, and since we will
@@ -2605,7 +2623,7 @@ void RenderFrameImpl::didCommitProvisionalLoad(
// new navigation.
navigation_state->set_request_committed(true);
- SendDidCommitProvisionalLoad(frame, commit_type);
+ SendDidCommitProvisionalLoad(frame, commit_type, item);
// Check whether we have new encoding name.
UpdateEncoding(frame, frame->view()->pageEncoding().utf8());
@@ -3724,7 +3742,8 @@ bool RenderFrameImpl::IsHidden() {
// Tell the embedding application that the URL of the active page has changed.
void RenderFrameImpl::SendDidCommitProvisionalLoad(
blink::WebFrame* frame,
- blink::WebHistoryCommitType commit_type) {
+ blink::WebHistoryCommitType commit_type,
+ const blink::WebHistoryItem& item) {
DCHECK(!frame_ || frame_ == frame);
WebDataSource* ds = frame->dataSource();
DCHECK(ds);
@@ -3790,10 +3809,10 @@ void RenderFrameImpl::SendDidCommitProvisionalLoad(
// Make navigation state a part of the DidCommitProvisionalLoad message so
// that committed entry has it at all times.
HistoryEntry* entry = render_view_->history_controller()->GetCurrentEntry();
- if (entry)
- params.page_state = HistoryEntryToPageState(entry);
- else
- params.page_state = PageState::CreateFromURL(request.url());
+ // TODO(creis): Change PageState to FrameState.
+ params.page_state = SingleHistoryItemToPageState(item);
+ params.item_sequence_number = item.itemSequenceNumber();
+ params.document_sequence_number = item.documentSequenceNumber();
if (!frame->parent()) {
// Top-level navigation.
@@ -4408,6 +4427,7 @@ bool RenderFrameImpl::PrepareRenderViewForNavigation(
// If this is a stale back/forward (due to a recent navigation the browser
// didn't know about), ignore it. Only check if swapped in because if the
// frame is swapped out, it won't commit before asking the browser.
+ // TODO(creis): Make this check work for OOPIF.
if (!render_view_->is_swapped_out() && is_history_navigation &&
render_view_->history_list_offset_ !=
history_params.current_history_list_offset) {
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_frame_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698