| Index: content/child/web_url_loader_impl.cc
|
| diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc
|
| index 80741405a603c8aa25d3e9c085b4b2d7bac65033..44d85642dc56c1348dce04f4c88f7049927db06b 100644
|
| --- a/content/child/web_url_loader_impl.cc
|
| +++ b/content/child/web_url_loader_impl.cc
|
| @@ -584,7 +584,8 @@ bool WebURLLoaderImpl::Context::OnReceivedRedirect(
|
| !info.was_fetched_via_service_worker,
|
| &new_request);
|
|
|
| - client_->willFollowRedirect(loader_, new_request, response);
|
| + client_->willFollowRedirect(loader_, new_request, response,
|
| + info.encoded_data_length);
|
| request_ = new_request;
|
|
|
| // Only follow the redirect if WebKit left the URL unmodified.
|
| @@ -699,7 +700,7 @@ void WebURLLoaderImpl::Context::OnReceivedData(
|
| std::unique_ptr<ReceivedData> data) {
|
| const char* payload = data->payload();
|
| int data_length = data->length();
|
| - int encoded_data_length = data->encoded_length();
|
| + int encoded_data_length = data->encoded_data_length();
|
| if (!client_)
|
| return;
|
|
|
| @@ -714,7 +715,8 @@ void WebURLLoaderImpl::Context::OnReceivedData(
|
| } else {
|
| // We dispatch the data even when |useStreamOnResponse()| is set, in order
|
| // to make Devtools work.
|
| - client_->didReceiveData(loader_, payload, data_length, encoded_data_length);
|
| + client_->didReceiveData(loader_, payload, data_length, encoded_data_length,
|
| + data->encoded_body_length());
|
|
|
| if (request_.useStreamOnResponse()) {
|
| // We don't support ftp_listening_delegate_ for now.
|
| @@ -853,9 +855,10 @@ void WebURLLoaderImpl::Context::HandleDataURL() {
|
|
|
| if (error_code == net::OK) {
|
| OnReceivedResponse(info);
|
| - if (!data.empty())
|
| + auto size = data.size();
|
| + if (size != 0)
|
| OnReceivedData(
|
| - base::WrapUnique(new FixedReceivedData(data.data(), data.size(), 0)));
|
| + base::WrapUnique(new FixedReceivedData(data.data(), size, 0, size)));
|
| }
|
|
|
| OnCompletedRequest(error_code, false, false, info.security_info,
|
| @@ -1121,9 +1124,10 @@ void WebURLLoaderImpl::loadSynchronously(const WebURLRequest& request,
|
|
|
| PopulateURLResponse(final_url, sync_load_response, &response,
|
| request.reportRawHeaders());
|
| + response.addToEncodedBodyLength(sync_load_response.encoded_body_length);
|
| + response.addToDecodedBodyLength(sync_load_response.data.size());
|
|
|
| - data.assign(sync_load_response.data.data(),
|
| - sync_load_response.data.size());
|
| + data.assign(sync_load_response.data.data(), sync_load_response.data.size());
|
| }
|
|
|
| void WebURLLoaderImpl::loadAsynchronously(const WebURLRequest& request,
|
|
|