summaryrefslogtreecommitdiffstats
path: root/net/url_request/url_request_file_job.h
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-28 23:34:43 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-28 23:34:43 +0000
commit6220bb7e9f8d8201fe66b71941a3b0458d16d8b5 (patch)
tree846a041439b14418677256309afffd77dc74fe31 /net/url_request/url_request_file_job.h
parentcf9995bcc40e8fd67551f660b7fe37cfd00b2c79 (diff)
downloadchromium_src-6220bb7e9f8d8201fe66b71941a3b0458d16d8b5.zip
chromium_src-6220bb7e9f8d8201fe66b71941a3b0458d16d8b5.tar.gz
chromium_src-6220bb7e9f8d8201fe66b71941a3b0458d16d8b5.tar.bz2
Supports single range request with file protocol
Added range request support in URLRequestFileJob to respect "Range" HTTP header. Fail with ERR_REQUESTED_RANGE_NOT_SATISFIABLE if range is bad. The following range request modes are supported: 1. Fully specified: bytes=x-y 2. With first byte position only: bytes=x- 3. With suffix length: bytes=-y Multiple ranges in a single request is not supported as we need to multipart encoding.. Review URL: http://codereview.chromium.org/92149 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14799 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/url_request_file_job.h')
-rw-r--r--net/url_request/url_request_file_job.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/url_request/url_request_file_job.h b/net/url_request/url_request_file_job.h
index 94b65c4..3091d2a 100644
--- a/net/url_request/url_request_file_job.h
+++ b/net/url_request/url_request_file_job.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.
@@ -11,6 +11,7 @@
#include "base/file_util.h"
#include "net/base/completion_callback.h"
#include "net/base/file_stream.h"
+#include "net/http/http_byte_range.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_job.h"
@@ -26,6 +27,7 @@ class URLRequestFileJob : public URLRequestJob {
virtual bool IsRedirectResponse(GURL* location, int* http_status_code);
virtual bool GetMimeType(std::string* mime_type) const;
virtual void GetResponseInfo(net::HttpResponseInfo* info);
+ virtual void SetExtraRequestHeaders(const std::string& headers);
static URLRequest::ProtocolFactory Factory;
@@ -41,6 +43,9 @@ class URLRequestFileJob : public URLRequestJob {
net::FileStream stream_;
bool is_directory_;
+ net::HttpByteRange byte_range_;
+ int64 remaining_bytes_;
+
#if defined(OS_WIN)
class AsyncResolver;
friend class AsyncResolver;