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

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

Issue 872473003: PlzNavigate: Remove the RequestNavigation IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 27943c8621494e0de62a4ab6922efe1d39fc7462..cf1bdbf29c56771c4a5ade16380bf878b2bc3204 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -951,9 +951,17 @@ void RenderFrameHostImpl::OnBeforeUnloadACK(
render_view_host_->StopHangMonitorTimeout();
send_before_unload_start_time_ = base::TimeTicks();
- frame_tree_node_->render_manager()->OnBeforeUnloadACK(
- unload_ack_is_for_cross_site_transition_, proceed,
- before_unload_end_time);
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserSideNavigation)) {
+ // TODO(clamy): see if before_unload_end_time should be transmitted to the
+ // Navigator.
+ frame_tree_node_->navigator()->OnBeforeUnloadACK(
+ frame_tree_node_, proceed);
+ } else {
+ frame_tree_node_->render_manager()->OnBeforeUnloadACK(
+ unload_ack_is_for_cross_site_transition_, proceed,
+ before_unload_end_time);
+ }
// If canceled, notify the delegate to cancel its pending navigation entry.
if (!proceed)
@@ -1102,12 +1110,13 @@ void RenderFrameHostImpl::OnUpdateEncoding(const std::string& encoding_name) {
}
void RenderFrameHostImpl::OnBeginNavigation(
- const FrameHostMsg_BeginNavigation_Params& params,
- const CommonNavigationParams& common_params) {
+ const CommonNavigationParams& common_params,
+ const BeginNavigationParams& begin_params,
+ scoped_refptr<ResourceRequestBody> body) {
CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableBrowserSideNavigation));
frame_tree_node()->navigator()->OnBeginNavigation(
- frame_tree_node(), params, common_params);
+ frame_tree_node(), common_params, begin_params, body);
}
void RenderFrameHostImpl::OnAccessibilityEvents(
@@ -1425,8 +1434,14 @@ void RenderFrameHostImpl::DispatchBeforeUnload(bool for_cross_site_transition) {
// the handler ran and allowed the navigation to proceed.
if (GetParent() || !IsRenderFrameLive()) {
// We don't have a live renderer, so just skip running beforeunload.
- frame_tree_node_->render_manager()->OnBeforeUnloadACK(
- for_cross_site_transition, true, base::TimeTicks::Now());
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserSideNavigation)) {
+ frame_tree_node_->navigator()->OnBeforeUnloadACK(
+ frame_tree_node_, true);
+ } else {
+ frame_tree_node_->render_manager()->OnBeforeUnloadACK(
+ for_cross_site_transition, true, base::TimeTicks::Now());
+ }
return;
}
TRACE_EVENT_ASYNC_BEGIN0(

Powered by Google App Engine
This is Rietveld 408576698