| 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_URL_REQUEST_TEST_UTIL_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 | 10 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 void set_allow_certificate_errors(bool val) { | 157 void set_allow_certificate_errors(bool val) { |
| 158 allow_certificate_errors_ = val; | 158 allow_certificate_errors_ = val; |
| 159 } | 159 } |
| 160 void set_credentials(const AuthCredentials& credentials) { | 160 void set_credentials(const AuthCredentials& credentials) { |
| 161 credentials_ = credentials; | 161 credentials_ = credentials; |
| 162 } | 162 } |
| 163 | 163 |
| 164 // query state | 164 // query state |
| 165 const std::string& data_received() const { return data_received_; } | 165 const std::string& data_received() const { return data_received_; } |
| 166 int bytes_received() const { return static_cast<int>(data_received_.size()); } | 166 int bytes_received() const { return static_cast<int>(data_received_.size()); } |
| 167 const net::IOBufferWithSize* metadata() const { return metadata_.get(); } |
| 167 int response_started_count() const { return response_started_count_; } | 168 int response_started_count() const { return response_started_count_; } |
| 168 int received_bytes_count() const { return received_bytes_count_; } | 169 int received_bytes_count() const { return received_bytes_count_; } |
| 169 int received_redirect_count() const { return received_redirect_count_; } | 170 int received_redirect_count() const { return received_redirect_count_; } |
| 170 bool received_data_before_response() const { | 171 bool received_data_before_response() const { |
| 171 return received_data_before_response_; | 172 return received_data_before_response_; |
| 172 } | 173 } |
| 173 bool request_failed() const { return request_failed_; } | 174 bool request_failed() const { return request_failed_; } |
| 174 bool have_certificate_errors() const { return have_certificate_errors_; } | 175 bool have_certificate_errors() const { return have_certificate_errors_; } |
| 175 bool certificate_errors_are_fatal() const { | 176 bool certificate_errors_are_fatal() const { |
| 176 return certificate_errors_are_fatal_; | 177 return certificate_errors_are_fatal_; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // tracks status of callbacks | 219 // tracks status of callbacks |
| 219 int response_started_count_; | 220 int response_started_count_; |
| 220 int received_bytes_count_; | 221 int received_bytes_count_; |
| 221 int received_redirect_count_; | 222 int received_redirect_count_; |
| 222 bool received_data_before_response_; | 223 bool received_data_before_response_; |
| 223 bool request_failed_; | 224 bool request_failed_; |
| 224 bool have_certificate_errors_; | 225 bool have_certificate_errors_; |
| 225 bool certificate_errors_are_fatal_; | 226 bool certificate_errors_are_fatal_; |
| 226 bool auth_required_; | 227 bool auth_required_; |
| 227 std::string data_received_; | 228 std::string data_received_; |
| 229 scoped_refptr<net::IOBufferWithSize> metadata_; |
| 228 bool have_full_request_headers_; | 230 bool have_full_request_headers_; |
| 229 HttpRequestHeaders full_request_headers_; | 231 HttpRequestHeaders full_request_headers_; |
| 230 bool response_completed_; | 232 bool response_completed_; |
| 231 | 233 |
| 232 // tracks status of request | 234 // tracks status of request |
| 233 int request_status_; | 235 int request_status_; |
| 234 | 236 |
| 235 // our read buffer | 237 // our read buffer |
| 236 scoped_refptr<IOBuffer> buf_; | 238 scoped_refptr<IOBuffer> buf_; |
| 237 }; | 239 }; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 NetworkDelegate* network_delegate) const override; | 425 NetworkDelegate* network_delegate) const override; |
| 424 void set_main_intercept_job(std::unique_ptr<URLRequestJob> job); | 426 void set_main_intercept_job(std::unique_ptr<URLRequestJob> job); |
| 425 | 427 |
| 426 private: | 428 private: |
| 427 mutable std::unique_ptr<URLRequestJob> main_intercept_job_; | 429 mutable std::unique_ptr<URLRequestJob> main_intercept_job_; |
| 428 }; | 430 }; |
| 429 | 431 |
| 430 } // namespace net | 432 } // namespace net |
| 431 | 433 |
| 432 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 434 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
| OLD | NEW |