Index: content/network/cache_url_loader.cc |
diff --git a/content/network/cache_url_loader.cc b/content/network/cache_url_loader.cc |
index dc8cc19225edaa8d150e6af0d1981d3f9b3d4bf2..67e0ab7588f99d8ea446cddd18916d052872de37 100644 |
--- a/content/network/cache_url_loader.cc |
+++ b/content/network/cache_url_loader.cc |
@@ -52,28 +52,13 @@ class CacheURLLoader { |
private: |
void DataAvailable(int result) { |
DCHECK_EQ(net::OK, result); |
- 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 = data_.size(); |
- mojo::DataPipe data_pipe(options); |
- |
- DCHECK(data_pipe.producer_handle.is_valid()); |
- DCHECK(data_pipe.consumer_handle.is_valid()); |
+ mojo::DataPipe data_pipe(data_.size()); |
CHECK( |
mojo::common::BlockingCopyFromString(data_, data_pipe.producer_handle)); |
client_->OnStartLoadingResponseBody(std::move(data_pipe.consumer_handle)); |
- |
- ResourceRequestCompletionStatus request_complete_data; |
- request_complete_data.error_code = net::OK; |
- request_complete_data.exists_in_cache = false; |
- request_complete_data.completion_time = base::TimeTicks::Now(); |
- request_complete_data.encoded_data_length = data_.size(); |
- request_complete_data.encoded_body_length = data_.size(); |
- client_->OnComplete(request_complete_data); |
+ client_->OnComplete(ResourceRequestCompletionStatus(data_.size())); |
// So we don't delete |this| in the constructor. |
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); |