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-29 02:04:23 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-29 02:04:23 +0000
commit661376a6c1eb3bd501398f225363c2d021288245 (patch)
treea3af92c3f89ae0fcd3cfc5e79e4a8f3217d7db04 /net/url_request/url_request_file_job.h
parentd9cf0786fb6f4e136c037d69e08e8adb57ee921b (diff)
downloadchromium_src-661376a6c1eb3bd501398f225363c2d021288245.zip
chromium_src-661376a6c1eb3bd501398f225363c2d021288245.tar.gz
chromium_src-661376a6c1eb3bd501398f225363c2d021288245.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.. Last review was here: http://codereview.chromium.org/92149 Review URL: http://codereview.chromium.org/102006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14817 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;