Chromium Code Reviews| Index: content/browser/frame_host/render_frame_host_manager.cc |
| diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc |
| index 52bd32f37601dc2185bb795d53305a4cc93df6cd..40721dad5665b1a0c0a70d956e0752d36d9bde73 100644 |
| --- a/content/browser/frame_host/render_frame_host_manager.cc |
| +++ b/content/browser/frame_host/render_frame_host_manager.cc |
| @@ -15,7 +15,6 @@ |
| #include "content/browser/frame_host/cross_site_transferring_request.h" |
| #include "content/browser/frame_host/debug_urls.h" |
| #include "content/browser/frame_host/interstitial_page_impl.h" |
| -#include "content/browser/frame_host/navigation_before_commit_info.h" |
| #include "content/browser/frame_host/navigation_controller_impl.h" |
| #include "content/browser/frame_host/navigation_entry_impl.h" |
| #include "content/browser/frame_host/navigation_request.h" |
| @@ -36,6 +35,7 @@ |
| #include "content/public/browser/notification_types.h" |
| #include "content/public/browser/render_widget_host_iterator.h" |
| #include "content/public/browser/render_widget_host_view.h" |
| +#include "content/public/browser/stream_handle.h" |
| #include "content/public/browser/user_metrics.h" |
| #include "content/public/browser/web_ui_controller.h" |
| #include "content/public/common/content_switches.h" |
| @@ -106,16 +106,6 @@ RenderFrameHostManager::~RenderFrameHostManager() { |
| // Delete any swapped out RenderFrameHosts. |
| STLDeleteValues(&proxy_hosts_); |
| - |
| - // PlzNavigate |
| - // There is an active navigation request for this RFHM so it needs to be |
| - // canceled. |
| - if (CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kEnableBrowserSideNavigation)) { |
| - if (navigation_request_.get()) |
| - navigation_request_->CancelNavigation(); |
| - } |
| - |
| } |
| void RenderFrameHostManager::Init(BrowserContext* browser_context, |
| @@ -595,39 +585,33 @@ void RenderFrameHostManager::OnBeginNavigation( |
| info.parent_is_main_frame = !frame_tree_node_->parent() ? |
| false : frame_tree_node_->parent()->IsMainFrame(); |
| + NavigationControllerImpl& controller = |
| + delegate_->GetControllerForRenderManager(); |
|
nasko
2014/09/24 21:15:34
nit: In general with out-of-process iframes we nee
davidben
2014/10/03 16:27:52
Acknowledged.
|
| + BrowserContext* browser_context = controller.GetBrowserContext(); |
| + |
| // TODO(clamy): Check if the current RFH should be initialized (in case it has |
| // crashed) not to display a sad tab while navigating. |
| // TODO(clamy): Spawn a speculative renderer process if we do not have one to |
| // use for the navigation. |
| - // If there is an ongoing request it must be canceled. |
| - if (navigation_request_.get()) |
| - navigation_request_->CancelNavigation(); |
| - |
| navigation_request_.reset(new NavigationRequest( |
| - info, frame_tree_node_->frame_tree_node_id())); |
| + info, browser_context, frame_tree_node_)); |
| navigation_request_->BeginNavigation(params.request_body); |
| } |
| // PlzNavigate |
| -void RenderFrameHostManager::CommitNavigation( |
| - const NavigationBeforeCommitInfo& info) { |
| +void RenderFrameHostManager::CommitNavigation(const GURL& url, |
| + ResourceResponse* response, |
| + scoped_ptr<StreamHandle> body) { |
| CHECK(CommandLine::ForCurrentProcess()->HasSwitch( |
| switches::kEnableBrowserSideNavigation)); |
| - DCHECK(navigation_request_.get()); |
| - // Ignores navigation commits if the request ID doesn't match the current |
| - // active request. |
| - if (navigation_request_->navigation_request_id() != |
| - info.navigation_request_id) { |
| - return; |
| - } |
| // Pick the right RenderFrameHost to commit the navigation. |
| SiteInstance* current_instance = render_frame_host_->GetSiteInstance(); |
| // TODO(clamy): Replace the default values by the right ones. This may require |
| // some storing in RequestNavigation. |
| SiteInstance* new_instance = GetSiteInstanceForNavigation( |
| - info.navigation_url, |
| + url, |
| NULL, |
| navigation_request_->info().navigation_params.transition_type, |
| false, |
| @@ -662,7 +646,7 @@ void RenderFrameHostManager::CommitNavigation( |
| } |
| frame_tree_node_->navigator()->CommitNavigation( |
| - render_frame_host_.get(), info); |
| + render_frame_host_.get(), url, response, body.Pass()); |
| } |
| void RenderFrameHostManager::Observe( |