Fix wrong NavigationRequest / pending NavigationEntry association.

When a new renderer initiated navigations starts it will either:
 1) Create a new pending navigation entry and use it.
 2) Reuse the existing pending navigation entry.

The problem is that (2) is very wrong. There is no reasons to do it.

For instance, when a main frame navigation starts, it creates a pending
NavigationEntry. Then if a subframe navigation starts, is reuses the
same pending NavigationEntry. This doesn't make sense.

Bug: 999932
Change-Id: I53152ab7b62bdf9bcf745b7512f3b1110d0b5e2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1818522
Reviewed-by: Arthur Sonzogni <[email protected]>
Reviewed-by: Charlie Reis <[email protected]>
Commit-Queue: Arthur Sonzogni <[email protected]>
Cr-Commit-Position: refs/heads/master@{#699678}
diff --git a/content/browser/frame_host/navigator_impl.h b/content/browser/frame_host/navigator_impl.h
index fce48a9..d95b4af 100644
--- a/content/browser/frame_host/navigator_impl.h
+++ b/content/browser/frame_host/navigator_impl.h
@@ -127,13 +127,12 @@
       const FrameHostMsg_DidCommitProvisionalLoad_Params& params,
       SiteInstance* site_instance);
 
-  // Called when a navigation has started in a main frame, to update the pending
-  // NavigationEntry if the controller does not currently have a
-  // browser-initiated one.
-  void DidStartMainFrameNavigation(
+  // Called when a renderer initiated navigation has started. Returns the
+  // pending NavigationEntry to be used. Either null or a new one owned
+  // NavigationController.
+  NavigationEntryImpl* GetNavigationEntryForRendererInitiatedNavigation(
       const mojom::CommonNavigationParams& common_params,
-      SiteInstanceImpl* site_instance,
-      NavigationHandleImpl* navigation_handle);
+      FrameTreeNode* frame_tree_node);
 
   // The NavigationController that will keep track of session history for all
   // RenderFrameHost objects using this NavigatorImpl.