Index: content/browser/web_contents/web_contents_impl.cc |
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
index 8cf5a0f673200bf3091efd98c5148bbd41fb4a4e..9d60c2d1a749734a18f588d7952f66ed6e6cb397 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -1882,13 +1882,16 @@ bool WebContentsImpl::NavigateToPendingEntry( |
NavigationController::ReloadType reload_type) { |
FrameTreeNode* node = frame_tree_.root(); |
- // If we are using --site-per-process, we should navigate in the FrameTreeNode |
- // specified in the pending entry. |
+ // Navigate in the FrameTreeNode specified in the pending entry, if any. This |
+ // is currently only used in --site-per-process and tests. |
NavigationEntryImpl* pending_entry = |
NavigationEntryImpl::FromNavigationEntry(controller_.GetPendingEntry()); |
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) && |
- pending_entry->frame_tree_node_id() != -1) { |
- node = frame_tree_.FindByID(pending_entry->frame_tree_node_id()); |
+ if (pending_entry->frame_tree_node_id() != -1) { |
+ FrameTreeNode* subframe = |
+ frame_tree_.FindByID(pending_entry->frame_tree_node_id()); |
+ DCHECK(subframe); |
+ if (subframe) |
+ node = subframe; |
} |
return node->navigator()->NavigateToPendingEntry( |