| 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 URLRequestJob class that pulls the net and http headers from disk. | 5 // A URLRequestJob class that pulls the net and http headers from disk. |
| 6 | 6 |
| 7 #ifndef NET_TEST_URL_REQUEST_URL_REQUEST_MOCK_HTTP_JOB_H_ | 7 #ifndef NET_TEST_URL_REQUEST_URL_REQUEST_MOCK_HTTP_JOB_H_ |
| 8 #define NET_TEST_URL_REQUEST_URL_REQUEST_MOCK_HTTP_JOB_H_ | 8 #define NET_TEST_URL_REQUEST_URL_REQUEST_MOCK_HTTP_JOB_H_ |
| 9 | 9 |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // Note that all file IO is done using |worker_pool|. | 33 // Note that all file IO is done using |worker_pool|. |
| 34 URLRequestMockHTTPJob(URLRequest* request, | 34 URLRequestMockHTTPJob(URLRequest* request, |
| 35 NetworkDelegate* network_delegate, | 35 NetworkDelegate* network_delegate, |
| 36 const base::FilePath& file_path, | 36 const base::FilePath& file_path, |
| 37 const scoped_refptr<base::TaskRunner>& task_runner); | 37 const scoped_refptr<base::TaskRunner>& task_runner); |
| 38 | 38 |
| 39 // URLRequestJob overrides. | 39 // URLRequestJob overrides. |
| 40 void Start() override; | 40 void Start() override; |
| 41 int64_t GetTotalReceivedBytes() const override; | 41 int64_t GetTotalReceivedBytes() const override; |
| 42 bool GetMimeType(std::string* mime_type) const override; | 42 bool GetMimeType(std::string* mime_type) const override; |
| 43 int GetResponseCode() const override; | |
| 44 bool GetCharset(std::string* charset) override; | 43 bool GetCharset(std::string* charset) override; |
| 45 void GetResponseInfo(HttpResponseInfo* info) override; | 44 void GetResponseInfo(HttpResponseInfo* info) override; |
| 46 bool IsRedirectResponse(GURL* location, int* http_status_code) override; | 45 bool IsRedirectResponse(GURL* location, int* http_status_code) override; |
| 47 | 46 |
| 48 // URLRequestFileJob overridess. | 47 // URLRequestFileJob overridess. |
| 49 void OnReadComplete(net::IOBuffer* buffer, int result) override; | 48 void OnReadComplete(net::IOBuffer* buffer, int result) override; |
| 50 | 49 |
| 51 // Adds the testing URLs to the URLRequestFilter, both under HTTP and HTTPS. | 50 // Adds the testing URLs to the URLRequestFilter, both under HTTP and HTTPS. |
| 52 static void AddUrlHandlers( | 51 static void AddUrlHandlers( |
| 53 const base::FilePath& base_path, | 52 const base::FilePath& base_path, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 const scoped_refptr<base::TaskRunner> task_runner_; | 84 const scoped_refptr<base::TaskRunner> task_runner_; |
| 86 | 85 |
| 87 base::WeakPtrFactory<URLRequestMockHTTPJob> weak_ptr_factory_; | 86 base::WeakPtrFactory<URLRequestMockHTTPJob> weak_ptr_factory_; |
| 88 | 87 |
| 89 DISALLOW_COPY_AND_ASSIGN(URLRequestMockHTTPJob); | 88 DISALLOW_COPY_AND_ASSIGN(URLRequestMockHTTPJob); |
| 90 }; | 89 }; |
| 91 | 90 |
| 92 } // namespace net | 91 } // namespace net |
| 93 | 92 |
| 94 #endif // NET_TEST_URL_REQUEST_URL_REQUEST_MOCK_HTTP_JOB_H_ | 93 #endif // NET_TEST_URL_REQUEST_URL_REQUEST_MOCK_HTTP_JOB_H_ |
| OLD | NEW |