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

Unified Diff: third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp

Issue 2835123005: Send the decoded size when response completed and stop summing in ResourceLoader::DidReceiveData() (Closed)
Patch Set: Created 3 years, 8 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
Index: third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
index 8d2c54eff8b0bbfd4ee9dacc428fd957829912b6..93c6c694f2475058feeace3c752d06cb74ff0ac8 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
@@ -400,7 +400,6 @@ void ResourceLoader::DidReceiveData(const char* data, int length) {
CHECK_GE(length, 0);
Context().DispatchDidReceiveData(resource_->Identifier(), data, length);
- resource_->AddToDecodedBodyLength(length);
resource_->AppendData(data, length);
}
@@ -421,9 +420,11 @@ void ResourceLoader::DidFinishLoadingFirstPartInMultipart() {
void ResourceLoader::DidFinishLoading(double finish_time,
int64_t encoded_data_length,
- int64_t encoded_body_length) {
+ int64_t encoded_body_length,
+ int64_t decoded_body_length) {
resource_->SetEncodedDataLength(encoded_data_length);
- resource_->AddToEncodedBodyLength(encoded_body_length);
+ resource_->SetEncodedBodyLength(encoded_body_length);
+ resource_->SetDecodedBodyLength(decoded_body_length);
loader_.reset();
@@ -437,9 +438,11 @@ void ResourceLoader::DidFinishLoading(double finish_time,
void ResourceLoader::DidFail(const WebURLError& error,
int64_t encoded_data_length,
- int64_t encoded_body_length) {
+ int64_t encoded_body_length,
+ int64_t decoded_body_length) {
resource_->SetEncodedDataLength(encoded_data_length);
- resource_->AddToEncodedBodyLength(encoded_body_length);
+ resource_->SetEncodedBodyLength(encoded_body_length);
+ resource_->SetDecodedBodyLength(decoded_body_length);
HandleError(error);
}
@@ -479,8 +482,10 @@ void ResourceLoader::RequestSynchronously(const ResourceRequest& request) {
// can bring about the cancellation of this load.
if (!loader_)
return;
+ int64_t decoded_body_length = data_out.size();
if (error_out.reason) {
- DidFail(error_out, encoded_data_length, encoded_body_length);
+ DidFail(error_out, encoded_data_length, encoded_body_length,
+ decoded_body_length);
return;
}
DidReceiveResponse(response_out);
@@ -498,7 +503,7 @@ void ResourceLoader::RequestSynchronously(const ResourceRequest& request) {
resource_->SetResourceBuffer(data_out);
}
DidFinishLoading(MonotonicallyIncreasingTime(), encoded_data_length,
- encoded_body_length);
+ encoded_body_length, decoded_body_length);
}
void ResourceLoader::Dispose() {

Powered by Google App Engine
This is Rietveld 408576698