| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/frame_host/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 } | 428 } |
| 429 | 429 |
| 430 bool NavigatorImpl::NavigateNewChildFrame( | 430 bool NavigatorImpl::NavigateNewChildFrame( |
| 431 RenderFrameHostImpl* render_frame_host, | 431 RenderFrameHostImpl* render_frame_host, |
| 432 const std::string& unique_name) { | 432 const std::string& unique_name) { |
| 433 NavigationEntryImpl* entry = | 433 NavigationEntryImpl* entry = |
| 434 controller_->GetEntryWithUniqueID(render_frame_host->nav_entry_id()); | 434 controller_->GetEntryWithUniqueID(render_frame_host->nav_entry_id()); |
| 435 if (!entry) | 435 if (!entry) |
| 436 return false; | 436 return false; |
| 437 | 437 |
| 438 // TODO(creis): Remove unique_name from the IPC, now that we can rely on the |
| 439 // replication state. |
| 440 DCHECK_EQ(render_frame_host->frame_tree_node()->unique_name(), unique_name); |
| 438 FrameNavigationEntry* frame_entry = | 441 FrameNavigationEntry* frame_entry = |
| 439 entry->GetFrameEntryByUniqueName(unique_name); | 442 entry->GetFrameEntry(render_frame_host->frame_tree_node()); |
| 440 if (!frame_entry) | 443 if (!frame_entry) |
| 441 return false; | 444 return false; |
| 442 | 445 |
| 443 // Update the FrameNavigationEntry's FrameTreeNode ID (which is currently the | |
| 444 // ID of the old FrameTreeNode that no longer exists) to be the ID of the | |
| 445 // newly created frame. | |
| 446 frame_entry->set_frame_tree_node_id( | |
| 447 render_frame_host->frame_tree_node()->frame_tree_node_id()); | |
| 448 | |
| 449 return NavigateToEntry(render_frame_host->frame_tree_node(), *frame_entry, | 446 return NavigateToEntry(render_frame_host->frame_tree_node(), *frame_entry, |
| 450 *entry, NavigationControllerImpl::NO_RELOAD, false, | 447 *entry, NavigationControllerImpl::NO_RELOAD, false, |
| 451 false); | 448 false); |
| 452 } | 449 } |
| 453 | 450 |
| 454 void NavigatorImpl::DidNavigate( | 451 void NavigatorImpl::DidNavigate( |
| 455 RenderFrameHostImpl* render_frame_host, | 452 RenderFrameHostImpl* render_frame_host, |
| 456 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) { | 453 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) { |
| 457 FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree(); | 454 FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree(); |
| 458 bool oopifs_possible = SiteIsolationPolicy::AreCrossProcessFramesPossible(); | 455 bool oopifs_possible = SiteIsolationPolicy::AreCrossProcessFramesPossible(); |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 if (pending_entry != controller_->GetVisibleEntry() || | 1091 if (pending_entry != controller_->GetVisibleEntry() || |
| 1095 !should_preserve_entry) { | 1092 !should_preserve_entry) { |
| 1096 controller_->DiscardPendingEntry(true); | 1093 controller_->DiscardPendingEntry(true); |
| 1097 | 1094 |
| 1098 // Also force the UI to refresh. | 1095 // Also force the UI to refresh. |
| 1099 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); | 1096 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); |
| 1100 } | 1097 } |
| 1101 } | 1098 } |
| 1102 | 1099 |
| 1103 } // namespace content | 1100 } // namespace content |
| OLD | NEW |