Index: content/browser/frame_host/navigator_impl.cc |
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc |
index bb4de6d38f6d21e33edf96f06a395f568cd796ac..da80d0671b204b8f3b9e2c4531288384018b364d 100644 |
--- a/content/browser/frame_host/navigator_impl.cc |
+++ b/content/browser/frame_host/navigator_impl.cc |
@@ -251,13 +251,14 @@ void NavigatorImpl::DidFailLoadWithError( |
bool NavigatorImpl::NavigateToEntry( |
FrameTreeNode* frame_tree_node, |
+ const FrameNavigationEntry& frame_nav_entry, |
const NavigationEntryImpl& entry, |
NavigationController::ReloadType reload_type) { |
TRACE_EVENT0("browser,navigation", "NavigatorImpl::NavigateToEntry"); |
// The renderer will reject IPC messages with URLs longer than |
// this limit, so don't attempt to navigate with a longer URL. |
- if (entry.GetURL().spec().size() > GetMaxURLChars()) { |
+ if (frame_nav_entry.url().spec().size() > GetMaxURLChars()) { |
LOG(WARNING) << "Refusing to load URL as it exceeds " << GetMaxURLChars() |
<< " characters."; |
return false; |
@@ -275,12 +276,14 @@ bool NavigatorImpl::NavigateToEntry( |
if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kEnableBrowserSideNavigation)) { |
navigation_data_.reset(new NavigationMetricsData( |
- navigation_start, entry.GetURL(), entry.restore_type())); |
- RequestNavigation(frame_tree_node, entry, reload_type, navigation_start); |
+ navigation_start, frame_nav_entry.url(), entry.restore_type())); |
+ RequestNavigation(frame_tree_node, frame_nav_entry, entry, reload_type, |
+ navigation_start); |
return true; |
} |
- RenderFrameHostImpl* dest_render_frame_host = manager->Navigate(entry); |
+ RenderFrameHostImpl* dest_render_frame_host = |
+ manager->Navigate(frame_nav_entry, entry); |
if (!dest_render_frame_host) |
return false; // Unable to create the desired RenderFrameHost. |
@@ -290,10 +293,12 @@ bool NavigatorImpl::NavigateToEntry( |
// For security, we should never send non-Web-UI URLs to a Web UI renderer. |
// Double check that here. |
CheckWebUIRendererDoesNotDisplayNormalURL( |
- dest_render_frame_host, entry.GetURL()); |
+ dest_render_frame_host, frame_nav_entry.url()); |
// Notify observers that we will navigate in this RenderFrame. |
if (delegate_) { |
+ // TODO(creis): Deprecate this API. We should not be accessing the current |
+ // RFH here. |
delegate_->AboutToNavigateRenderFrame(frame_tree_node->current_frame_host(), |
dest_render_frame_host); |
} |
@@ -308,17 +313,17 @@ bool NavigatorImpl::NavigateToEntry( |
dest_render_frame_host->GetProcess()->GetID(); |
if (!is_transfer_to_same) { |
navigation_data_.reset(new NavigationMetricsData( |
- navigation_start, entry.GetURL(), entry.restore_type())); |
+ navigation_start, frame_nav_entry.url(), entry.restore_type())); |
// Create the navigation parameters. |
// TODO(vitalybuka): Move this before AboutToNavigateRenderFrame once |
// http://crbug.com/408684 is fixed. |
FrameMsg_Navigate_Type::Value navigation_type = |
GetNavigationType(controller_->GetBrowserContext(), entry, reload_type); |
dest_render_frame_host->Navigate( |
- entry.ConstructCommonNavigationParams(navigation_type), |
+ entry.ConstructCommonNavigationParams(frame_nav_entry, navigation_type), |
entry.ConstructStartNavigationParams(), |
entry.ConstructCommitNavigationParams(navigation_start), |
- entry.ConstructHistoryNavigationParams(controller_)); |
+ entry.ConstructHistoryNavigationParams(frame_nav_entry, controller_)); |
} else { |
// No need to navigate again. Just resume the deferred request. |
dest_render_frame_host->GetProcess()->ResumeDeferredNavigation( |
@@ -334,22 +339,25 @@ bool NavigatorImpl::NavigateToEntry( |
// do not generate content. What we really need is a message from the |
// renderer telling us that a new page was not created. The same message |
// could be used for mailto: URLs and the like. |
- if (entry.GetURL().SchemeIs(url::kJavaScriptScheme)) |
+ if (frame_nav_entry.url().SchemeIs(url::kJavaScriptScheme)) |
return false; |
} |
// Notify observers about navigation. |
- if (delegate_) |
- delegate_->DidStartNavigationToPendingEntry(entry.GetURL(), reload_type); |
+ if (delegate_) { |
+ delegate_->DidStartNavigationToPendingEntry(frame_nav_entry.url(), |
+ reload_type); |
+ } |
return true; |
} |
bool NavigatorImpl::NavigateToPendingEntry( |
FrameTreeNode* frame_tree_node, |
+ const FrameNavigationEntry& frame_nav_entry, |
NavigationController::ReloadType reload_type) { |
- return NavigateToEntry(frame_tree_node, *controller_->GetPendingEntry(), |
- reload_type); |
+ return NavigateToEntry(frame_tree_node, frame_nav_entry, |
+ *controller_->GetPendingEntry(), reload_type); |
} |
void NavigatorImpl::DidNavigate( |
@@ -441,11 +449,6 @@ void NavigatorImpl::DidNavigate( |
bool did_navigate = controller_->RendererDidNavigate(render_frame_host, |
params, &details); |
- // For now, keep track of each frame's URL in its FrameTreeNode. This lets |
- // us estimate our process count for implementing OOP iframes. |
- // TODO(creis): Remove this when we track which pages commit in each frame. |
- render_frame_host->frame_tree_node()->set_current_url(params.url); |
- |
// Send notification about committed provisional loads. This notification is |
// different from the NAV_ENTRY_COMMITTED notification which doesn't include |
// the actual URL navigated to and isn't sent for AUTO_SUBFRAME navigations. |
@@ -774,6 +777,7 @@ void NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL( |
// PlzNavigate |
void NavigatorImpl::RequestNavigation( |
FrameTreeNode* frame_tree_node, |
+ const FrameNavigationEntry& frame_entry, |
const NavigationEntryImpl& entry, |
NavigationController::ReloadType reload_type, |
base::TimeTicks navigation_start) { |
@@ -783,6 +787,7 @@ void NavigatorImpl::RequestNavigation( |
int64 frame_tree_node_id = frame_tree_node->frame_tree_node_id(); |
FrameMsg_Navigate_Type::Value navigation_type = |
GetNavigationType(controller_->GetBrowserContext(), entry, reload_type); |
+ // TODO(creis): Pass frame_entry and get the URL and referrer from there. |
scoped_ptr<NavigationRequest> navigation_request = |
NavigationRequest::CreateBrowserInitiated(frame_tree_node, entry, |
navigation_type, |