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

Unified Diff: content/network/url_loader_impl.cc

Issue 2875143002: Reduce boilerplate when creating simple mojom::URLLoaders. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « content/network/cache_url_loader.cc ('k') | media/mojo/common/mojo_decoder_buffer_converter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/network/url_loader_impl.cc
diff --git a/content/network/url_loader_impl.cc b/content/network/url_loader_impl.cc
index 80680db87fce8087fb1c1cabbd394b0851067596..8d2143e08485ce32d1602031fec1ea5cc6dea5b6 100644
--- a/content/network/url_loader_impl.cc
+++ b/content/network/url_loader_impl.cc
@@ -268,15 +268,7 @@ void URLLoaderImpl::OnResponseStarted(net::URLRequest* url_request,
std::vector<uint8_t>(data, data + metadata->size()));
}
- MojoCreateDataPipeOptions options;
- options.struct_size = sizeof(MojoCreateDataPipeOptions);
- options.flags = MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE;
- options.element_num_bytes = 1;
- options.capacity_num_bytes = kDefaultAllocationSize;
- mojo::DataPipe data_pipe(options);
-
- DCHECK(data_pipe.producer_handle.is_valid());
- DCHECK(data_pipe.consumer_handle.is_valid());
+ mojo::DataPipe data_pipe(kDefaultAllocationSize);
response_body_stream_ = std::move(data_pipe.producer_handle);
response_body_consumer_handle_ = std::move(data_pipe.consumer_handle);
« no previous file with comments | « content/network/cache_url_loader.cc ('k') | media/mojo/common/mojo_decoder_buffer_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698