summaryrefslogtreecommitdiffstats
path: root/net/http/http_response_headers.h
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-22 20:38:07 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-22 20:38:07 +0000
commitd807bf963f1960566263b20de2997bd74ebca1a6 (patch)
tree192dee8817f1848051746701f61c63638efc7ab2 /net/http/http_response_headers.h
parent36345874fb0086e5fc509caf01e84d26fd982afd (diff)
downloadchromium_src-d807bf963f1960566263b20de2997bd74ebca1a6.zip
chromium_src-d807bf963f1960566263b20de2997bd74ebca1a6.tar.gz
chromium_src-d807bf963f1960566263b20de2997bd74ebca1a6.tar.bz2
Implement HttpResponseHeaders::GetContentRange and unittests
Parse "Content-Range" header in HttpResponseHeaders according to RFC 2616 14.16. Review URL: http://codereview.chromium.org/88068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14238 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_response_headers.h')
-rw-r--r--net/http/http_response_headers.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/net/http/http_response_headers.h b/net/http/http_response_headers.h
index e9b2c4b..830c09c 100644
--- a/net/http/http_response_headers.h
+++ b/net/http/http_response_headers.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -196,6 +196,17 @@ class HttpResponseHeaders :
// no such header in the response.
int64 GetContentLength() const;
+ // Extracts the values in Content-Range header, if the header exists and is
+ // well formatted returns true, else returns false.
+ // The following values will be outputted:
+ // |*first_byte_position| = inclusive position of the first byte of the range
+ // |*last_byte_position| = inclusive position of the last byte of the range
+ // |*instance_length| = size in bytes of the object requested
+ // If any of the above values is unknown, its value will be -1.
+ bool GetContentRange(int64* first_byte_position,
+ int64* last_byte_position,
+ int64* instance_length) const;
+
// Returns the HTTP response code. This is 0 if the response code text seems
// to exist but could not be parsed. Otherwise, it defaults to 200 if the
// response code is not found in the raw headers.