Chromium Code Reviews| 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 #include "net/url_request/url_request_test_util.h" | 5 #include "net/url_request/url_request_test_util.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 const int kStageCompletedSuccess = 1 << 7; | 46 const int kStageCompletedSuccess = 1 << 7; |
| 47 const int kStageCompletedError = 1 << 8; | 47 const int kStageCompletedError = 1 << 8; |
| 48 const int kStageURLRequestDestroyed = 1 << 9; | 48 const int kStageURLRequestDestroyed = 1 << 9; |
| 49 const int kStageDestruction = 1 << 10; | 49 const int kStageDestruction = 1 << 10; |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| 52 | 52 |
| 53 TestURLRequestContext::TestURLRequestContext() | 53 TestURLRequestContext::TestURLRequestContext() |
| 54 : initialized_(false), | 54 : initialized_(false), |
| 55 client_socket_factory_(NULL), | 55 client_socket_factory_(NULL), |
| 56 proxy_delegate_(NULL), | |
| 56 context_storage_(this) { | 57 context_storage_(this) { |
| 57 Init(); | 58 Init(); |
| 58 } | 59 } |
| 59 | 60 |
| 60 TestURLRequestContext::TestURLRequestContext(bool delay_initialization) | 61 TestURLRequestContext::TestURLRequestContext(bool delay_initialization) |
| 61 : initialized_(false), | 62 : initialized_(false), |
| 62 client_socket_factory_(NULL), | 63 client_socket_factory_(NULL), |
|
bengr
2016/02/08 23:23:30
Suggest changing every NULL to a nullptr.
RyanSturm
2016/02/09 00:46:03
Done.
| |
| 64 proxy_delegate_(NULL), | |
| 63 context_storage_(this) { | 65 context_storage_(this) { |
| 64 if (!delay_initialization) | 66 if (!delay_initialization) |
| 65 Init(); | 67 Init(); |
| 66 } | 68 } |
| 67 | 69 |
| 68 TestURLRequestContext::~TestURLRequestContext() { | 70 TestURLRequestContext::~TestURLRequestContext() { |
| 69 DCHECK(initialized_); | 71 DCHECK(initialized_); |
| 70 AssertNoURLRequests(); | 72 AssertNoURLRequests(); |
| 71 } | 73 } |
| 72 | 74 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 92 } | 94 } |
| 93 if (!http_server_properties()) { | 95 if (!http_server_properties()) { |
| 94 context_storage_.set_http_server_properties( | 96 context_storage_.set_http_server_properties( |
| 95 scoped_ptr<HttpServerProperties>(new HttpServerPropertiesImpl())); | 97 scoped_ptr<HttpServerProperties>(new HttpServerPropertiesImpl())); |
| 96 } | 98 } |
| 97 if (http_transaction_factory()) { | 99 if (http_transaction_factory()) { |
| 98 // Make sure we haven't been passed an object we're not going to use. | 100 // Make sure we haven't been passed an object we're not going to use. |
| 99 EXPECT_FALSE(client_socket_factory_); | 101 EXPECT_FALSE(client_socket_factory_); |
| 100 } else { | 102 } else { |
| 101 HttpNetworkSession::Params params; | 103 HttpNetworkSession::Params params; |
| 102 if (http_network_session_params_) | 104 |
| 105 if (http_network_session_params_) { | |
|
bengr
2016/02/08 23:23:30
Remove curly braces. Chromium doesn't use them on
RyanSturm
2016/02/09 00:46:03
Done.
| |
| 103 params = *http_network_session_params_; | 106 params = *http_network_session_params_; |
| 107 } | |
| 104 params.client_socket_factory = client_socket_factory(); | 108 params.client_socket_factory = client_socket_factory(); |
| 109 params.proxy_delegate = proxy_delegate(); | |
| 105 params.host_resolver = host_resolver(); | 110 params.host_resolver = host_resolver(); |
| 106 params.cert_verifier = cert_verifier(); | 111 params.cert_verifier = cert_verifier(); |
| 107 params.transport_security_state = transport_security_state(); | 112 params.transport_security_state = transport_security_state(); |
| 108 params.proxy_service = proxy_service(); | 113 params.proxy_service = proxy_service(); |
| 109 params.ssl_config_service = ssl_config_service(); | 114 params.ssl_config_service = ssl_config_service(); |
| 110 params.http_auth_handler_factory = http_auth_handler_factory(); | 115 params.http_auth_handler_factory = http_auth_handler_factory(); |
| 111 params.network_delegate = network_delegate(); | 116 params.network_delegate = network_delegate(); |
| 112 params.http_server_properties = http_server_properties(); | 117 params.http_server_properties = http_server_properties(); |
| 113 params.net_log = net_log(); | 118 params.net_log = net_log(); |
| 114 params.channel_id_service = channel_id_service(); | 119 params.channel_id_service = channel_id_service(); |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 649 URLRequest* request, | 654 URLRequest* request, |
| 650 NetworkDelegate* network_delegate) const { | 655 NetworkDelegate* network_delegate) const { |
| 651 return main_intercept_job_.release(); | 656 return main_intercept_job_.release(); |
| 652 } | 657 } |
| 653 | 658 |
| 654 void TestJobInterceptor::set_main_intercept_job(scoped_ptr<URLRequestJob> job) { | 659 void TestJobInterceptor::set_main_intercept_job(scoped_ptr<URLRequestJob> job) { |
| 655 main_intercept_job_ = std::move(job); | 660 main_intercept_job_ = std::move(job); |
| 656 } | 661 } |
| 657 | 662 |
| 658 } // namespace net | 663 } // namespace net |
| OLD | NEW |