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

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

Issue 1811913003: PlzNavigate: support NavigationThrottle::WillProcessResponse (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on top of 1832803002 Created 4 years, 9 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 677db31ef1c40849a7bff9145afaa5ff97a1b535..337b03bddcda1225a94521947822b980ee6e6b8b 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -2006,8 +2006,8 @@ void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) {
FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), LOFI_OFF,
base::TimeTicks::Now(), "GET");
if (IsBrowserSideNavigationEnabled()) {
- CommitNavigation(nullptr, nullptr, common_params,
- RequestNavigationParams());
+ CommitNavigation(nullptr, nullptr, common_params, RequestNavigationParams(),
+ false);
} else {
Navigate(common_params, StartNavigationParams(), RequestNavigationParams());
}
@@ -2137,7 +2137,8 @@ void RenderFrameHostImpl::CommitNavigation(
ResourceResponse* response,
scoped_ptr<StreamHandle> body,
const CommonNavigationParams& common_params,
- const RequestNavigationParams& request_params) {
+ const RequestNavigationParams& request_params,
+ bool is_view_source) {
DCHECK((response && body.get()) ||
!ShouldMakeNetworkRequestForURL(common_params.url));
UpdatePermissionsForNavigation(common_params, request_params);
@@ -2146,6 +2147,14 @@ void RenderFrameHostImpl::CommitNavigation(
// completing a RFH swap or unload handler.
SetState(RenderFrameHostImpl::STATE_DEFAULT);
+ // The renderer can exit view source mode when any error or cancellation
+ // happen. When reusing the same renderer, overwrite to recover the mode.
+ if (is_view_source &&
+ this == frame_tree_node_->render_manager()->current_frame_host()) {
+ DCHECK(!GetParent());
+ render_view_host()->Send(new FrameMsg_EnableViewSourceMode(routing_id_));
+ }
+
const GURL body_url = body.get() ? body->GetURL() : GURL();
const ResourceResponseHead head = response ?
response->head : ResourceResponseHead();
@@ -2163,7 +2172,6 @@ void RenderFrameHostImpl::CommitNavigation(
if (!common_params.url.SchemeIs(url::kJavaScriptScheme)) {
pending_commit_ = true;
is_loading_ = true;
- frame_tree_node_->ResetNavigationRequest(true);
}
}
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/loader/navigation_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698