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 #ifndef NET_URL_REQUEST_TEST_URL_FETCHER_FACTORY_H_ | 5 #ifndef NET_URL_REQUEST_TEST_URL_FETCHER_FACTORY_H_ |
6 #define NET_URL_REQUEST_TEST_URL_FETCHER_FACTORY_H_ | 6 #define NET_URL_REQUEST_TEST_URL_FETCHER_FACTORY_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
11 #include <map> | 11 #include <map> |
12 #include <string> | 12 #include <string> |
13 #include <utility> | 13 #include <utility> |
14 | 14 |
15 #include "base/basictypes.h" | |
16 #include "base/callback.h" | 15 #include "base/callback.h" |
17 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
18 #include "base/files/file_path.h" | 17 #include "base/files/file_path.h" |
| 18 #include "base/macros.h" |
19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
20 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
21 #include "base/threading/non_thread_safe.h" | 21 #include "base/threading/non_thread_safe.h" |
22 #include "net/http/http_request_headers.h" | 22 #include "net/http/http_request_headers.h" |
23 #include "net/http/http_status_code.h" | 23 #include "net/http/http_status_code.h" |
24 #include "net/url_request/url_fetcher_factory.h" | 24 #include "net/url_request/url_fetcher_factory.h" |
25 #include "net/url_request/url_request_status.h" | 25 #include "net/url_request/url_request_status.h" |
26 #include "url/gurl.h" | 26 #include "url/gurl.h" |
27 | 27 |
28 namespace net { | 28 namespace net { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 const GURL& url, | 87 const GURL& url, |
88 URLFetcherDelegate* d); | 88 URLFetcherDelegate* d); |
89 ~TestURLFetcher() override; | 89 ~TestURLFetcher() override; |
90 | 90 |
91 // URLFetcher implementation | 91 // URLFetcher implementation |
92 void SetUploadData(const std::string& upload_content_type, | 92 void SetUploadData(const std::string& upload_content_type, |
93 const std::string& upload_content) override; | 93 const std::string& upload_content) override; |
94 void SetUploadFilePath( | 94 void SetUploadFilePath( |
95 const std::string& upload_content_type, | 95 const std::string& upload_content_type, |
96 const base::FilePath& file_path, | 96 const base::FilePath& file_path, |
97 uint64 range_offset, | 97 uint64_t range_offset, |
98 uint64 range_length, | 98 uint64_t range_length, |
99 scoped_refptr<base::TaskRunner> file_task_runner) override; | 99 scoped_refptr<base::TaskRunner> file_task_runner) override; |
100 void SetUploadStreamFactory( | 100 void SetUploadStreamFactory( |
101 const std::string& upload_content_type, | 101 const std::string& upload_content_type, |
102 const CreateUploadStreamCallback& callback) override; | 102 const CreateUploadStreamCallback& callback) override; |
103 void SetChunkedUpload(const std::string& upload_content_type) override; | 103 void SetChunkedUpload(const std::string& upload_content_type) override; |
104 // Overriden to cache the chunks uploaded. Caller can read back the uploaded | 104 // Overriden to cache the chunks uploaded. Caller can read back the uploaded |
105 // chunks with the upload_chunks() accessor. | 105 // chunks with the upload_chunks() accessor. |
106 void AppendChunkToUpload(const std::string& data, | 106 void AppendChunkToUpload(const std::string& data, |
107 bool is_last_chunk) override; | 107 bool is_last_chunk) override; |
108 void SetLoadFlags(int load_flags) override; | 108 void SetLoadFlags(int load_flags) override; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 GURL fake_url_; | 225 GURL fake_url_; |
226 URLRequestStatus fake_status_; | 226 URLRequestStatus fake_status_; |
227 int fake_response_code_; | 227 int fake_response_code_; |
228 ResponseCookies fake_cookies_; | 228 ResponseCookies fake_cookies_; |
229 ResponseDestinationType fake_response_destination_; | 229 ResponseDestinationType fake_response_destination_; |
230 std::string fake_response_string_; | 230 std::string fake_response_string_; |
231 base::FilePath fake_response_file_path_; | 231 base::FilePath fake_response_file_path_; |
232 bool write_response_file_; | 232 bool write_response_file_; |
233 bool fake_was_fetched_via_proxy_; | 233 bool fake_was_fetched_via_proxy_; |
234 bool fake_was_cached_; | 234 bool fake_was_cached_; |
235 int64 fake_response_bytes_; | 235 int64_t fake_response_bytes_; |
236 scoped_refptr<HttpResponseHeaders> fake_response_headers_; | 236 scoped_refptr<HttpResponseHeaders> fake_response_headers_; |
237 HttpRequestHeaders fake_extra_request_headers_; | 237 HttpRequestHeaders fake_extra_request_headers_; |
238 int fake_max_retries_; | 238 int fake_max_retries_; |
239 base::TimeDelta fake_backoff_delay_; | 239 base::TimeDelta fake_backoff_delay_; |
240 scoped_ptr<URLFetcherResponseWriter> response_writer_; | 240 scoped_ptr<URLFetcherResponseWriter> response_writer_; |
241 | 241 |
242 DISALLOW_COPY_AND_ASSIGN(TestURLFetcher); | 242 DISALLOW_COPY_AND_ASSIGN(TestURLFetcher); |
243 }; | 243 }; |
244 | 244 |
245 typedef TestURLFetcher::DelegateForTests TestURLFetcherDelegateForTests; | 245 typedef TestURLFetcher::DelegateForTests TestURLFetcherDelegateForTests; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 // This method will create a real URLFetcher. | 468 // This method will create a real URLFetcher. |
469 scoped_ptr<URLFetcher> CreateURLFetcher(int id, | 469 scoped_ptr<URLFetcher> CreateURLFetcher(int id, |
470 const GURL& url, | 470 const GURL& url, |
471 URLFetcher::RequestType request_type, | 471 URLFetcher::RequestType request_type, |
472 URLFetcherDelegate* d) override; | 472 URLFetcherDelegate* d) override; |
473 }; | 473 }; |
474 | 474 |
475 } // namespace net | 475 } // namespace net |
476 | 476 |
477 #endif // NET_URL_REQUEST_TEST_URL_FETCHER_FACTORY_H_ | 477 #endif // NET_URL_REQUEST_TEST_URL_FETCHER_FACTORY_H_ |
OLD | NEW |