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

Unified Diff: content/browser/loader/async_resource_handler.cc

Issue 2506363005: Send encoded_body_length to renderer when response completed (3/3) (Closed)
Patch Set: fix Created 4 years, 1 month 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
Index: content/browser/loader/async_resource_handler.cc
diff --git a/content/browser/loader/async_resource_handler.cc b/content/browser/loader/async_resource_handler.cc
index b626cab4d7c28a9ad7abd2489947b08499e272d1..aadc7256a228b8738469aa67581bde5b233a7886 100644
--- a/content/browser/loader/async_resource_handler.cc
+++ b/content/browser/loader/async_resource_handler.cc
@@ -125,7 +125,6 @@ class AsyncResourceHandler::InliningHelper {
// Returns true if the received data is sent to the consumer.
bool SendInlinedDataIfApplicable(int bytes_read,
int encoded_data_length,
- int encoded_body_length,
IPC::Sender* sender,
int request_id) {
DCHECK(sender);
@@ -138,7 +137,7 @@ class AsyncResourceHandler::InliningHelper {
leading_chunk_buffer_ = nullptr;
sender->Send(new ResourceMsg_InlinedDataChunkReceived(
- request_id, data, encoded_data_length, encoded_body_length));
+ request_id, data, encoded_data_length));
return true;
}
@@ -215,8 +214,7 @@ AsyncResourceHandler::AsyncResourceHandler(
inlining_helper_(new InliningHelper),
last_upload_position_(0),
waiting_for_upload_progress_ack_(false),
- reported_transfer_size_(0),
- reported_encoded_body_length_(0) {
+ reported_transfer_size_(0) {
InitializeResourceBufferConstants();
}
@@ -430,12 +428,11 @@ bool AsyncResourceHandler::OnReadCompleted(int bytes_read, bool* defer) {
if (!first_chunk_read_)
encoded_data_length -= request()->raw_header_size();
- int encoded_body_length = CalculateEncodedBodyLengthToReport();
first_chunk_read_ = true;
// Return early if InliningHelper handled the received data.
if (inlining_helper_->SendInlinedDataIfApplicable(
- bytes_read, encoded_data_length, encoded_body_length, filter,
+ bytes_read, encoded_data_length, filter,
GetRequestID()))
return true;
@@ -455,8 +452,7 @@ bool AsyncResourceHandler::OnReadCompleted(int bytes_read, bool* defer) {
int data_offset = buffer_->GetLastAllocationOffset();
filter->Send(new ResourceMsg_DataReceived(GetRequestID(), data_offset,
- bytes_read, encoded_data_length,
- encoded_body_length));
+ bytes_read, encoded_data_length));
++pending_data_count_;
if (!buffer_->CanAllocate()) {
@@ -563,11 +559,6 @@ int AsyncResourceHandler::CalculateEncodedDataLengthToReport() {
&reported_transfer_size_);
}
-int AsyncResourceHandler::CalculateEncodedBodyLengthToReport() {
- return TrackDifference(request()->GetRawBodyBytes(),
- &reported_encoded_body_length_);
-}
-
void AsyncResourceHandler::RecordHistogram() {
int64_t elapsed_time =
(base::TimeTicks::Now() - response_started_ticks_).InMicroseconds();
« no previous file with comments | « content/browser/loader/async_resource_handler.h ('k') | content/browser/loader/async_resource_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698