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

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

Issue 297973002: Navigation transitions: Block first response until after transitions have run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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/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 0dfdeaae6274c6845249c5eab665319a3083c627..fcb42473c62dc78f49d36db955dcb35210590e5e 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -62,6 +62,13 @@ RenderFrameHostManager::PendingNavigationParams::PendingNavigationParams(
RenderFrameHostManager::PendingNavigationParams::~PendingNavigationParams() {}
+RenderFrameHostManager::ResponseStartedParams::ResponseStartedParams(
+ const GlobalRequestID& global_request_id)
+ : global_request_id(global_request_id) {
+}
+
+RenderFrameHostManager::ResponseStartedParams::~ResponseStartedParams() {}
+
bool RenderFrameHostManager::ClearRFHsPendingShutdown(FrameTreeNode* node) {
node->render_manager()->pending_delete_hosts_.clear();
return true;
@@ -348,6 +355,35 @@ void RenderFrameHostManager::OnCrossSiteResponse(
SwapOutOldPage();
}
+void RenderFrameHostManager::OnDeferredAfterResponseStarted(
+ const GlobalRequestID& global_request_id,
+ RenderFrameHostImpl* pending_render_frame_host) {
+ DCHECK(!response_started_params_.get());
+
+ response_started_params_.reset(new ResponseStartedParams(
+ global_request_id));
+}
+
+void RenderFrameHostManager::SetHasPendingTransitionRequest(
+ bool has_pending_transition) {
+ render_frame_host_->render_view_host()->SetHasPendingTransitionRequest(
+ has_pending_transition);
+}
+
+void RenderFrameHostManager::ResumeResponseDeferredAtStart() {
+ DCHECK(response_started_params_.get());
+
+ RenderProcessHostImpl* process =
+ static_cast<RenderProcessHostImpl*>(
+ render_frame_host_->GetProcess());
+ process->ResumeResponseDeferredAtStart(
+ response_started_params_->global_request_id);
+
+ render_frame_host_->render_view_host()->SetHasPendingTransitionRequest(false);
+
+ response_started_params_.reset();
+}
+
void RenderFrameHostManager::SwappedOut(
RenderFrameHostImpl* render_frame_host) {
// Make sure this is from our current RFH, and that we have a pending

Powered by Google App Engine
This is Rietveld 408576698