OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "net/base/completion_callback.h" | 12 #include "net/base/completion_callback.h" |
13 #include "net/base/file_stream.h" | 13 #include "net/base/file_stream.h" |
14 #include "net/http/http_byte_range.h" | 14 #include "net/http/http_byte_range.h" |
15 #include "net/url_request/url_request.h" | 15 #include "net/url_request/url_request.h" |
16 #include "net/url_request/url_request_job.h" | 16 #include "net/url_request/url_request_job.h" |
17 | 17 |
18 // A request job that handles reading file URLs | 18 // A request job that handles reading file URLs |
19 class URLRequestFileJob : public URLRequestJob { | 19 class URLRequestFileJob : public URLRequestJob { |
20 public: | 20 public: |
21 URLRequestFileJob(URLRequest* request, const FilePath& file_path); | 21 URLRequestFileJob(URLRequest* request, const FilePath& file_path); |
22 virtual ~URLRequestFileJob(); | 22 virtual ~URLRequestFileJob(); |
23 | 23 |
24 virtual void Start(); | 24 virtual void Start(); |
25 virtual void Kill(); | 25 virtual void Kill(); |
26 virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read); | 26 virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read); |
27 virtual bool IsRedirectResponse(GURL* location, int* http_status_code); | 27 virtual bool IsRedirectResponse(GURL* location, int* http_status_code); |
| 28 virtual bool GetContentEncodings( |
| 29 std::vector<Filter::FilterType>* encoding_type); |
28 virtual bool GetMimeType(std::string* mime_type) const; | 30 virtual bool GetMimeType(std::string* mime_type) const; |
29 virtual void GetResponseInfo(net::HttpResponseInfo* info); | 31 virtual void GetResponseInfo(net::HttpResponseInfo* info); |
30 virtual void SetExtraRequestHeaders(const std::string& headers); | 32 virtual void SetExtraRequestHeaders(const std::string& headers); |
31 | 33 |
32 static URLRequest::ProtocolFactory Factory; | 34 static URLRequest::ProtocolFactory Factory; |
33 | 35 |
34 protected: | 36 protected: |
35 // The OS-specific full path name of the file | 37 // The OS-specific full path name of the file |
36 FilePath file_path_; | 38 FilePath file_path_; |
37 | 39 |
(...skipping 11 matching lines...) Expand all Loading... |
49 #if defined(OS_WIN) | 51 #if defined(OS_WIN) |
50 class AsyncResolver; | 52 class AsyncResolver; |
51 friend class AsyncResolver; | 53 friend class AsyncResolver; |
52 scoped_refptr<AsyncResolver> async_resolver_; | 54 scoped_refptr<AsyncResolver> async_resolver_; |
53 #endif | 55 #endif |
54 | 56 |
55 DISALLOW_COPY_AND_ASSIGN(URLRequestFileJob); | 57 DISALLOW_COPY_AND_ASSIGN(URLRequestFileJob); |
56 }; | 58 }; |
57 | 59 |
58 #endif // NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_ | 60 #endif // NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_ |
OLD | NEW |