Commit 0a9167f9 authored by ananta's avatar ananta Committed by Commit bot

PlzNavigate: Pass the encoded resource transfer size to the renderer.

This should fix the http/tests/misc/resource-timing-sizes-tags.html layout test.
The other test http/tests/inspector/resource-har-conversion.html needs an expectation
change to allow the custom header which is passed for PlzNavigate. Will do that in a later
patchset.

Changes on this patch are to implement the GetTotalReceivedBytes() override for the StreamURLRequestJob class

BUG=673745

Review-Url: https://codereview.chromium.org/2612683002
Cr-Commit-Position: refs/heads/master@{#441409}
parent c4778979
......@@ -145,6 +145,15 @@ int StreamURLRequestJob::GetResponseCode() const {
return response_info_->headers->response_code();
}
int64_t StreamURLRequestJob::GetTotalReceivedBytes() const {
int64_t total_received_bytes = 0;
if (response_info_)
total_received_bytes = response_info_->headers->raw_headers().size();
if (stream_.get())
total_received_bytes += total_bytes_read_;
return total_received_bytes;
}
void StreamURLRequestJob::DidStart() {
if (range_parse_result() == net::OK && ranges().size() > 0) {
// Only one range is supported, and it must start at the first byte.
......
......@@ -34,6 +34,7 @@ class CONTENT_EXPORT StreamURLRequestJob
bool GetMimeType(std::string* mime_type) const override;
void GetResponseInfo(net::HttpResponseInfo* info) override;
int GetResponseCode() const override;
int64_t GetTotalReceivedBytes() const override;
protected:
~StreamURLRequestJob() override;
......@@ -50,6 +51,7 @@ class CONTENT_EXPORT StreamURLRequestJob
int pending_buffer_size_;
std::unique_ptr<net::HttpResponseInfo> response_info_;
// Total bytes received for this job.
int total_bytes_read_;
int max_range_;
bool request_failed_;
......
......@@ -145,10 +145,6 @@ crbug.com/673742 fast/dom/Document/open-with-pending-load.html [ Failure ]
# https://crbug.com/673744 Popups should open in the correct window
crbug.com/673744 fast/dom/HTMLAnchorElement/anchor-no-multiple-windows.html [ Failure ]
# https://crbug.com/673745 Resource transfer size should be forwarded to blink
crbug.com/673745 http/tests/misc/resource-timing-sizes-tags.html [ Failure ]
crbug.com/673745 virtual/mojo-loading/http/tests/misc/resource-timing-sizes-tags.html [ Failure ]
# Timeout when receiving a 204 response
# Note (clamy): I haven't filed a bug yet since
# https://codereview.chromium.org/2549373004/ will modify 204 handling when it
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment