Fix WebContentsDelegate::ShouldCreateWebContents implementations.

The problem was that |route_id| is scoped to a particular child process,
but the process was not being plumbed in correctly, resulting in a
situation where we would create (1) a RenderFrameHost with a routing ID
that might later be reused, and also, (2) a RenderFrameHost with a
plumbed-in routing ID, but no corresponding extant RenderFrame in the
child process.

The solution involves plumbing in the actual SiteInstance, and only
using |route_id| if we don't change to a different SiteInstance.

BUG=627852
[email protected]

Review-Url: https://codereview.chromium.org/2521793003
Cr-Commit-Position: refs/heads/master@{#434743}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 24be3e29..d6accb2 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2065,9 +2065,10 @@
 
   if (delegate_ &&
       !delegate_->ShouldCreateWebContents(
-          this, route_id, main_frame_route_id, main_frame_widget_route_id,
-          params.window_container_type, params.frame_name, params.target_url,
-          partition_id, session_storage_namespace)) {
+          this, source_site_instance, route_id, main_frame_route_id,
+          main_frame_widget_route_id, params.window_container_type,
+          params.opener_url, params.frame_name, params.target_url, partition_id,
+          session_storage_namespace)) {
     if (route_id != MSG_ROUTING_NONE &&
         !RenderViewHost::FromID(render_process_id, route_id)) {
       // If the embedder didn't create a WebContents for this route, we need to