New issue
Advanced search Search tips

Issue 670913 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 657994



Sign in to add a comment

Refactor and clean up the API of HttpResponseHeaders::GetContentRange() so that other components can more easily depend on it

Project Member Reported by sclit...@chromium.org, Dec 3 2016

Issue description

Currently, the API of GetContentRange() mainly supports validating and extracting values from a Content-Range response header for a 206 response, but it also has partial support for extracting values from Content-Range headers from 416 responses without validation.

Nothing appears to use this 416 Content-Range support, so let's remove it and change the API of that method accordingly.

The Content-Range header parsing logic should also be moved out of HttpResponseHeaders so that other components (e.g. third_party/WebKit) can more easily make use of it.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 3 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0a4f767df75c67cf8f068a352997ac89313b0022

commit 0a4f767df75c67cf8f068a352997ac89313b0022
Author: sclittle <sclittle@chromium.org>
Date: Sat Dec 03 03:45:54 2016

Refactor Content-Range response header parsing into http_util

Refactor Content-Range response header parsing into http_util so that
it's easier for other components to depend on it without needing to go
through HttpResponseHeaders.

BUG= 670913 

Review-Url: https://codereview.chromium.org/2545213002
Cr-Commit-Position: refs/heads/master@{#436162}

[modify] https://crrev.com/0a4f767df75c67cf8f068a352997ac89313b0022/net/http/http_response_headers.cc
[modify] https://crrev.com/0a4f767df75c67cf8f068a352997ac89313b0022/net/http/http_util.cc
[modify] https://crrev.com/0a4f767df75c67cf8f068a352997ac89313b0022/net/http/http_util.h
[modify] https://crrev.com/0a4f767df75c67cf8f068a352997ac89313b0022/net/http/http_util_unittest.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Dec 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d43b2fbe1d074927d76c6fa6fb7e4cd816b8527a

commit d43b2fbe1d074927d76c6fa6fb7e4cd816b8527a
Author: sclittle <sclittle@chromium.org>
Date: Sat Dec 17 03:20:47 2016

Cleaned up the API of HttpUtil::ParseContentRangeHeader().

HttpUtil::ParseContentRangeHeader() is used to validate and extract
values from a Content-Range header for a 206 response.

Before this CL, ParseContentRangeHeader() also had partial support for
extracting values from a Content-Range header for a 416 response,
without validating the returned values.

This behavior didn't appear to be used by any production code, so this
CL removes that support and makes ParseContentRangeHeader return true
only if all three of |first_byte_position|, |last_byte_position|, and
|instance_length| are specified and valid for a 206 response; otherwise,
all outputs are set to -1 and returns false.

BUG= 670913 

Review-Url: https://codereview.chromium.org/2549143003
Cr-Commit-Position: refs/heads/master@{#439305}

[modify] https://crrev.com/d43b2fbe1d074927d76c6fa6fb7e4cd816b8527a/chrome/browser/extensions/blob_reader.cc
[modify] https://crrev.com/d43b2fbe1d074927d76c6fa6fb7e4cd816b8527a/content/browser/appcache/appcache_url_request_job_unittest.cc
[modify] https://crrev.com/d43b2fbe1d074927d76c6fa6fb7e4cd816b8527a/content/browser/blob_storage/blob_url_request_job_unittest.cc
[modify] https://crrev.com/d43b2fbe1d074927d76c6fa6fb7e4cd816b8527a/content/browser/download/download_request_core.cc
[modify] https://crrev.com/d43b2fbe1d074927d76c6fa6fb7e4cd816b8527a/net/http/http_cache_unittest.cc
[modify] https://crrev.com/d43b2fbe1d074927d76c6fa6fb7e4cd816b8527a/net/http/http_response_headers.cc
[modify] https://crrev.com/d43b2fbe1d074927d76c6fa6fb7e4cd816b8527a/net/http/http_response_headers.h
[modify] https://crrev.com/d43b2fbe1d074927d76c6fa6fb7e4cd816b8527a/net/http/http_response_headers_unittest.cc
[modify] https://crrev.com/d43b2fbe1d074927d76c6fa6fb7e4cd816b8527a/net/http/http_util.cc
[modify] https://crrev.com/d43b2fbe1d074927d76c6fa6fb7e4cd816b8527a/net/http/http_util.h
[modify] https://crrev.com/d43b2fbe1d074927d76c6fa6fb7e4cd816b8527a/net/http/http_util_unittest.cc
[modify] https://crrev.com/d43b2fbe1d074927d76c6fa6fb7e4cd816b8527a/net/http/partial_data.cc

Status: Fixed (was: Started)

Sign in to add a comment