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

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

Issue 701953006: PlzNavigate: Speculatively spawns a renderer process for navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated tests and refactored code based on CR comments. Created 6 years 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
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 39956621dfd5f5cfadb5b0ad0fe123726f7e58ce..500a4737c0b54c465edcf9651f5fea37f16fe490 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -754,10 +754,11 @@ void NavigatorImpl::OnBeginNavigation(
info->parent_is_main_frame = !frame_tree_node->parent() ?
false : frame_tree_node->parent()->IsMainFrame();
- // TODO(clamy): Inform the RenderFrameHostManager that a navigation is about
- // to begin, so that it can speculatively spawn a new renderer if needed.
-
+ // First starts the IO/net requests.
clamy 2014/12/09 15:09:52 nit: I would rephrase as "First start the request
carlosk 2014/12/16 01:53:47 Done.
navigation_request->BeginNavigation(info.Pass(), params.request_body);
+ // Then notify the manager so it can speculatively create a renderer in
clamy 2014/12/09 15:09:52 Please add a line before the comment. nit: s/manag
carlosk 2014/12/16 01:53:47 Done.
+ // parallel.
+ frame_tree_node->render_manager()->BeginNavigation(params, common_params);
}
// PlzNavigate
@@ -798,6 +799,7 @@ void NavigatorImpl::CancelNavigation(FrameTreeNode* frame_tree_node) {
CHECK(CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableBrowserSideNavigation));
navigation_request_map_.erase(frame_tree_node->frame_tree_node_id());
+ frame_tree_node->render_manager()->CleanUpNavigation();
}
// PlzNavigate

Powered by Google App Engine
This is Rietveld 408576698