New issue
Advanced search Search tips

Issue 605632 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: May 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Remove URLRequest::GetExpectedContentSize() / URLRequestJob::expected_content_size()

Project Member Reported by mmenke@chromium.org, Apr 21 2016

Issue description

Contrary to popular belief, for HTTP requests, this is not actually the expected size of the uncompressed content, but rather the size of the response body before decompression.  The name here is confusing, and we should discourage anything from caring about the Content-Length of a response.  It also returns -1 when unknown, which can also lead to unexpected behaviors.

I'd like us to remove the method.  Consumers can still access the Content-Length header, but I think we can live with that.  Note that removing this method is fairly involved - we have a number of consumers in the browser process, and pass it down to the renderer as well.  Wherever we reasonably can, we should make consumers not care about the content length value, rather than just switching them to pulling it directly from the response.

Labeling this as a net-fixit bug.  It's probably too much for a single fixit, but could work on decreasing the number of callsites, in preparation for removal.
 

Comment 1 by eroman@chromium.org, Apr 21 2016

Summary: Remove URLRequest::GetExpectedContentSize() / URLRequestJob::expected_content_size() (was: Remove URLRequest::expected_content_size())
Status: WontFix (was: Available)
And it was just pointed out to me that GetExpectedContentSize() returns -1 whenever there's a filter, so it does work as people actually expect it to.  Going to WontFix this, but I am going to add a comment to the method.

Sign in to add a comment