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

Unified Diff: content/browser/frame_host/navigation_controller_impl.cc

Issue 1303333006: Don't crash for subframes after in-page navigations in --site-per-process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | content/browser/frame_host/navigation_controller_impl_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_controller_impl.cc
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index e447c0e24c998ad9f629885282f1963b6fc29e23..f2e96f959aeed725d959eab9c7f9c818e389cf9d 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -901,7 +901,10 @@ bool NavigationControllerImpl::RendererDidNavigate(
// Update the frame-specific PageState.
FrameNavigationEntry* frame_entry =
active_entry->GetFrameEntry(rfh->frame_tree_node());
- frame_entry->set_page_state(params.page_state);
+ // We may not find a frame_entry in some cases; ignore the PageState if so.
+ // TODO(creis): Remove the "if" once https://crbug.com/522193 is fixed.
+ if (frame_entry)
+ frame_entry->set_page_state(params.page_state);
} else {
active_entry->SetPageState(params.page_state);
}
@@ -1243,7 +1246,11 @@ void NavigationControllerImpl::RendererDidNavigateNewSubframe(
rfh->GetSiteInstance(), params.url, params.referrer);
new_entry = GetLastCommittedEntry()->CloneAndReplace(rfh->frame_tree_node(),
frame_entry);
- CHECK(frame_entry->HasOneRef());
+
+ // TODO(creis): Make sure the last committed entry always has the subframe
+ // entry to replace, and CHECK(frame_entry->HasOneRef). For now, we might
+ // not find the entry to replace, and new_entry will be deleted when it goes
+ // out of scope. See https://crbug.com/522193.
} else {
new_entry = GetLastCommittedEntry()->Clone();
}
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_controller_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698