[go: nahoru, domu]

Http cache: Extend support for byte range requests.

* Now we handle regular requests (not byte range requests) that
  end up reading a cached entry that stores byte ranges. In this
  case we create a control object (partial_), but it's byte_range_
  member is always invalid because the user is not requesting
  a range.

* Given that we may find stored 206s that are not keeping sparse
  data, we detect that case and handle it.

* Now we may end up reading 206 from disk (and the net) and having
  to change the returned status to be 200 (for regular requests).

* We avoid performing re-validations for each piece of stored data.
  Instead, we consider the whole entry to be revalidated once, and
  read from the cache without asking the server (as far as we can).

* When processing the received headers we now consider receiving
  200 and 416 (instead of 206/304) and we handle inconsistencies
  in the range returned by the server (from what we expect). We
  also handle receiving 206 when we don't expect it.

BUG=12258
TEST=unittests

Review URL: http://codereview.chromium.org/164304

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23123 0039d316-1c4b-4281-b951-d872f2087c98
7 files changed