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

Side by Side Diff: content/browser/loader/mojo_async_resource_handler.cc

Issue 2515383004: Revert of Send encoded_body_length to renderer when response completed (1/3) (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/loader/async_resource_handler_unittest.cc ('k') | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698