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

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

Issue 2797443005: PlzNavigate data pipe
Patch Set: cleanup Created 3 years, 8 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 a8c82e863dbfd511cd21baba1f2a62ab2f1d9d01..5efcf4389f992932521a244f0005102310823114 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -2659,8 +2659,8 @@ void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) {
base::Optional<SourceLocation>(),
CSPDisposition::CHECK /* should_check_main_world_csp */);
if (IsBrowserSideNavigationEnabled()) {
- CommitNavigation(nullptr, nullptr, common_params, RequestNavigationParams(),
- false);
+ CommitNavigation(nullptr, mojo::ScopedDataPipeConsumerHandle(),
+ common_params, RequestNavigationParams(), false);
} else {
Navigate(common_params, StartNavigationParams(), RequestNavigationParams());
}
@@ -2836,12 +2836,12 @@ void RenderFrameHostImpl::SendJavaScriptDialogReply(
// PlzNavigate
void RenderFrameHostImpl::CommitNavigation(
ResourceResponse* response,
- std::unique_ptr<StreamHandle> body,
+ mojo::ScopedDataPipeConsumerHandle handle,
const CommonNavigationParams& common_params,
const RequestNavigationParams& request_params,
bool is_view_source) {
DCHECK(
- (response && body.get()) ||
+ (response && handle.is_valid()) ||
common_params.url.SchemeIs(url::kDataScheme) ||
!ShouldMakeNetworkRequestForURL(common_params.url) ||
FrameMsg_Navigate_Type::IsSameDocument(common_params.navigation_type) ||
@@ -2860,11 +2860,10 @@ void RenderFrameHostImpl::CommitNavigation(
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();
- Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, common_params,
- request_params));
+ Send(new FrameMsg_CommitNavigation(routing_id_, head, handle.release(),
+ common_params, request_params));
// If a network request was made, update the Previews state.
if (ShouldMakeNetworkRequestForURL(common_params.url) &&
@@ -2872,10 +2871,6 @@ void RenderFrameHostImpl::CommitNavigation(
last_navigation_previews_state_ = common_params.previews_state;
}
- // TODO(clamy): Release the stream handle once the renderer has finished
- // reading it.
- stream_handle_ = std::move(body);
-
// When navigating to a debug url, no commit is expected from the
// RenderFrameHost, nor should the throbber start. The NavigationRequest is
// also not stored in the FrameTreeNode. Therefore do not reset it, as this
« 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