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

Unified Diff: content/child/web_url_loader_impl.cc

Issue 1693563002: PROTOTYPE: PlzNavigate: use a Mojo data pipe to stream navigation data to the renderer. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Browser sends URLRequest id to the renderer and renderer uses intermediary buffer for data: none he… 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
« no previous file with comments | « content/child/web_url_loader_impl.h ('k') | content/child/web_url_loader_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/web_url_loader_impl.cc
diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc
index 2b9d783dc2f095bfb18439cbf41a802a624a32c9..910f533cde646b973f6685ba434842872c38f20e 100644
--- a/content/child/web_url_loader_impl.cc
+++ b/content/child/web_url_loader_impl.cc
@@ -289,6 +289,10 @@ void SetSecurityStyleAndDetails(const GURL& url,
} // namespace
+StreamOverrideParameters::StreamOverrideParameters() : browser_request_id(-1) {}
+
+StreamOverrideParameters::~StreamOverrideParameters() {}
+
// This inner class exists since the WebURLLoader may be deleted while inside a
// call to WebURLLoaderClient. Refcounting is to keep the context from being
// deleted if it may have work to do after calling into the client.
@@ -542,25 +546,32 @@ void WebURLLoaderImpl::Context::Start(const WebURLRequest& request,
scoped_refptr<ResourceRequestBody> request_body =
GetRequestBodyForWebURLRequest(request).get();
- // PlzNavigate: during navigation, the renderer should request a stream which
- // contains the body of the response. The network request has already been
- // made by the browser.
- if (stream_override_.get()) {
- CHECK(IsBrowserSideNavigationEnabled());
- DCHECK(!sync_load_response);
- DCHECK_NE(WebURLRequest::FrameTypeNone, request.getFrameType());
- request_info.resource_body_stream_url = stream_override_->stream_url;
- }
-
if (sync_load_response) {
+ DCHECK(!stream_override_);
resource_dispatcher_->StartSync(
request_info, request_body.get(), sync_load_response);
return;
}
+ // PlzNavigate: during navigation, the browser should have sent a consumer
+ // handle for a Mojo data pipe along with the respective browser generated
+ // request id. The network request has already been made by the browser.
+ mojo::ScopedDataPipeConsumerHandle mojo_data_pipe_handle;
+ int browser_request_id = -1;
+ if (stream_override_) {
+ CHECK(IsBrowserSideNavigationEnabled());
+ DCHECK(!sync_load_response);
+ DCHECK_NE(WebURLRequest::FrameTypeNone, request.getFrameType());
+ DCHECK(stream_override_->mojo_handle.is_valid());
+ DCHECK_LT(stream_override_->browser_request_id, -1);
+ mojo_data_pipe_handle = std::move(stream_override_->mojo_handle);
+ browser_request_id = stream_override_->browser_request_id;
+ }
+
request_id_ = resource_dispatcher_->StartAsync(
request_info, request_body.get(),
- make_scoped_ptr(new WebURLLoaderImpl::RequestPeerImpl(this)));
+ make_scoped_ptr(new WebURLLoaderImpl::RequestPeerImpl(this)),
+ std::move(mojo_data_pipe_handle), browser_request_id);
}
void WebURLLoaderImpl::Context::SetWebTaskRunner(
« no previous file with comments | « content/child/web_url_loader_impl.h ('k') | content/child/web_url_loader_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698