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

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

Issue 2954623003: PlzNavigate: implement REUSE_COMMITTED_OR_PENDING_SITE for redirects (Closed)
Patch Set: Created 3 years, 6 months 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/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index c130d36cb8f03cfcae883698c7b3a69c35df445b..ff27c014f9f98c3e284b02f2c0b5caa1363f0709 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -553,6 +553,14 @@ void NavigationRequest::OnRequestRedirected(
}
}
+ // Compute the SiteInstance to use for the redirect and pass its
+ // RenderProcessHost ID if it has a process.
Charlie Reis 2017/06/27 04:24:53 nit: ID vs RenderProcessHost
clamy 2017/06/27 15:23:05 Done.
+ scoped_refptr<SiteInstance> site_instance =
+ frame_tree_node_->render_manager()->GetSiteInstanceForNavigationRequest(
+ *this);
Charlie Reis 2017/06/27 04:24:53 I'm a small bit concerned that it's possible for t
clamy 2017/06/27 15:23:05 It seems the tests are fine with the change. For t
Charlie Reis 2017/06/27 18:46:34 I remembered the more specific problem we had in t
clamy 2017/06/28 14:08:31 I don't think the case you mention can happen. In
Charlie Reis 2017/06/28 17:05:22 Good point-- such a SiteInstance wouldn't have a p
clamy 2017/06/30 15:12:59 Since we should still consider the speculative RFH
+ RenderProcessHost* expected_process =
+ site_instance->HasProcess() ? site_instance->GetProcess() : nullptr;
clamy 2017/06/23 12:44:48 This actually introduces a new issue - the SiteIns
nasko 2017/06/23 20:23:23 If 1 is really easier, I don't mind going with it
Charlie Reis 2017/06/27 04:24:53 Nice find! I think 2 makes sense, assuming it doe
clamy 2017/06/27 15:23:05 I'm trying option 2, and running the tests. If the
Charlie Reis 2017/06/27 18:46:34 Great. The tests look happy.
clamy 2017/06/28 14:08:32 No we leave it in place until the navigation is re
+
// It's safe to use base::Unretained because this NavigationRequest owns the
// NavigationHandle where the callback will be stored.
bool is_external_protocol =
@@ -560,7 +568,7 @@ void NavigationRequest::OnRequestRedirected(
navigation_handle_->WillRedirectRequest(
common_params_.url, common_params_.method, common_params_.referrer.url,
is_external_protocol, response->head.headers,
- response->head.connection_info,
+ response->head.connection_info, expected_process,
base::Bind(&NavigationRequest::OnRedirectChecksComplete,
base::Unretained(this)));
}

Powered by Google App Engine
This is Rietveld 408576698