OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // A net::URLRequestJob class that pulls the content and http headers from disk. | 5 // A net::URLRequestJob class that pulls the content and http headers from disk. |
6 | 6 |
7 #ifndef CONTENT_TEST_NET_URL_REQUEST_MOCK_HTTP_JOB_H_ | 7 #ifndef CONTENT_TEST_NET_URL_REQUEST_MOCK_HTTP_JOB_H_ |
8 #define CONTENT_TEST_NET_URL_REQUEST_MOCK_HTTP_JOB_H_ | 8 #define CONTENT_TEST_NET_URL_REQUEST_MOCK_HTTP_JOB_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "net/url_request/url_request_file_job.h" | 12 #include "net/url_request/url_request_file_job.h" |
13 | 13 |
14 class FilePath; | 14 class FilePath; |
15 | 15 |
16 class URLRequestMockHTTPJob : public net::URLRequestFileJob { | 16 class URLRequestMockHTTPJob : public net::URLRequestFileJob { |
17 public: | 17 public: |
18 URLRequestMockHTTPJob(net::URLRequest* request, const FilePath& file_path); | 18 URLRequestMockHTTPJob(net::URLRequest* request, |
| 19 net::NetworkDelegate* network_delegate, |
| 20 const FilePath& file_path); |
19 | 21 |
20 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; | 22 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; |
21 virtual int GetResponseCode() const OVERRIDE; | 23 virtual int GetResponseCode() const OVERRIDE; |
22 virtual bool GetCharset(std::string* charset) OVERRIDE; | 24 virtual bool GetCharset(std::string* charset) OVERRIDE; |
23 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE; | 25 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE; |
24 virtual bool IsRedirectResponse(GURL* location, | 26 virtual bool IsRedirectResponse(GURL* location, |
25 int* http_status_code) OVERRIDE; | 27 int* http_status_code) OVERRIDE; |
26 | 28 |
27 static net::URLRequest::ProtocolFactory Factory; | 29 static net::URLRequest::ProtocolFactory Factory; |
28 | 30 |
(...skipping 13 matching lines...) Expand all Loading... |
42 | 44 |
43 static FilePath GetOnDiskPath(const FilePath& base_path, | 45 static FilePath GetOnDiskPath(const FilePath& base_path, |
44 net::URLRequest* request, | 46 net::URLRequest* request, |
45 const std::string& scheme); | 47 const std::string& scheme); |
46 | 48 |
47 private: | 49 private: |
48 void GetResponseInfoConst(net::HttpResponseInfo* info) const; | 50 void GetResponseInfoConst(net::HttpResponseInfo* info) const; |
49 }; | 51 }; |
50 | 52 |
51 #endif // CONTENT_TEST_NET_URL_REQUEST_MOCK_HTTP_JOB_H_ | 53 #endif // CONTENT_TEST_NET_URL_REQUEST_MOCK_HTTP_JOB_H_ |
OLD | NEW |