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

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

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
« no previous file with comments | « content/browser/loader/mojo_async_resource_handler.h ('k') | content/child/resource_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/mojo_async_resource_handler.cc
diff --git a/content/browser/loader/mojo_async_resource_handler.cc b/content/browser/loader/mojo_async_resource_handler.cc
index 24735ccf3bf78098de8181cdbab6bc472fb0a96d..938915e34bc61a7c693aea3991ca1415c18365f2 100644
--- a/content/browser/loader/mojo_async_resource_handler.cc
+++ b/content/browser/loader/mojo_async_resource_handler.cc
@@ -400,8 +400,10 @@ MojoResult MojoAsyncResourceHandler::BeginWrite(void** data,
MojoResult MojoAsyncResourceHandler::EndWrite(uint32_t written) {
MojoResult result = mojo::EndWriteDataRaw(shared_writer_->writer(), written);
- if (result == MOJO_RESULT_OK)
+ if (result == MOJO_RESULT_OK) {
+ total_written_bytes_ += written;
handle_watcher_.ArmOrNotify();
+ }
return result;
}
@@ -452,6 +454,7 @@ void MojoAsyncResourceHandler::OnResponseCompleted(
request_complete_data.encoded_data_length =
request()->GetTotalReceivedBytes();
request_complete_data.encoded_body_length = request()->GetRawBodyBytes();
+ request_complete_data.decoded_body_length = total_written_bytes_;
url_loader_client_->OnComplete(request_complete_data);
controller->Resume();
« no previous file with comments | « content/browser/loader/mojo_async_resource_handler.h ('k') | content/child/resource_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698