OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/loader/mojo_async_resource_handler.h" | 5 #include "content/browser/loader/mojo_async_resource_handler.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 // the ERR_ABORTED error code). | 330 // the ERR_ABORTED error code). |
331 DCHECK(!was_ignored_by_handler || error_code == net::ERR_ABORTED); | 331 DCHECK(!was_ignored_by_handler || error_code == net::ERR_ABORTED); |
332 | 332 |
333 ResourceRequestCompletionStatus request_complete_data; | 333 ResourceRequestCompletionStatus request_complete_data; |
334 request_complete_data.error_code = error_code; | 334 request_complete_data.error_code = error_code; |
335 request_complete_data.was_ignored_by_handler = was_ignored_by_handler; | 335 request_complete_data.was_ignored_by_handler = was_ignored_by_handler; |
336 request_complete_data.exists_in_cache = request()->response_info().was_cached; | 336 request_complete_data.exists_in_cache = request()->response_info().was_cached; |
337 request_complete_data.completion_time = base::TimeTicks::Now(); | 337 request_complete_data.completion_time = base::TimeTicks::Now(); |
338 request_complete_data.encoded_data_length = | 338 request_complete_data.encoded_data_length = |
339 request()->GetTotalReceivedBytes(); | 339 request()->GetTotalReceivedBytes(); |
340 request_complete_data.encoded_body_length = request()->GetRawBodyBytes(); | |
341 | 340 |
342 url_loader_client_->OnComplete(request_complete_data); | 341 url_loader_client_->OnComplete(request_complete_data); |
343 } | 342 } |
344 | 343 |
345 bool MojoAsyncResourceHandler::CopyReadDataToDataPipe(bool* defer) { | 344 bool MojoAsyncResourceHandler::CopyReadDataToDataPipe(bool* defer) { |
346 while (true) { | 345 while (true) { |
347 scoped_refptr<net::IOBufferWithSize> dest; | 346 scoped_refptr<net::IOBufferWithSize> dest; |
348 if (!AllocateWriterIOBuffer(&dest, defer)) | 347 if (!AllocateWriterIOBuffer(&dest, defer)) |
349 return false; | 348 return false; |
350 if (*defer) | 349 if (*defer) |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 const ResourceRequestInfoImpl* info = GetRequestInfo(); | 432 const ResourceRequestInfoImpl* info = GetRequestInfo(); |
434 ResourceDispatcherHostImpl::Get()->CancelRequestFromRenderer( | 433 ResourceDispatcherHostImpl::Get()->CancelRequestFromRenderer( |
435 GlobalRequestID(info->GetChildID(), info->GetRequestID())); | 434 GlobalRequestID(info->GetChildID(), info->GetRequestID())); |
436 } | 435 } |
437 | 436 |
438 void MojoAsyncResourceHandler::ReportBadMessage(const std::string& error) { | 437 void MojoAsyncResourceHandler::ReportBadMessage(const std::string& error) { |
439 mojo::ReportBadMessage(error); | 438 mojo::ReportBadMessage(error); |
440 } | 439 } |
441 | 440 |
442 } // namespace content | 441 } // namespace content |
OLD | NEW |