| Index: net/url_request/url_request_test_util.cc
|
| diff --git a/net/url_request/url_request_test_util.cc b/net/url_request/url_request_test_util.cc
|
| index 60f0f36c8b73fb273257b8ad4fbd52387ad47656..34e1f0bc715acc63e63cec630e4c2e646b3b34f9 100644
|
| --- a/net/url_request/url_request_test_util.cc
|
| +++ b/net/url_request/url_request_test_util.cc
|
| @@ -45,28 +45,30 @@ const int kStageBeforeRedirect = 1 << 5;
|
| const int kStageResponseStarted = 1 << 6;
|
| const int kStageCompletedSuccess = 1 << 7;
|
| const int kStageCompletedError = 1 << 8;
|
| const int kStageURLRequestDestroyed = 1 << 9;
|
| const int kStageDestruction = 1 << 10;
|
|
|
| } // namespace
|
|
|
| TestURLRequestContext::TestURLRequestContext()
|
| : initialized_(false),
|
| - client_socket_factory_(NULL),
|
| + client_socket_factory_(nullptr),
|
| + proxy_delegate_(nullptr),
|
| context_storage_(this) {
|
| Init();
|
| }
|
|
|
| TestURLRequestContext::TestURLRequestContext(bool delay_initialization)
|
| : initialized_(false),
|
| - client_socket_factory_(NULL),
|
| + client_socket_factory_(nullptr),
|
| + proxy_delegate_(nullptr),
|
| context_storage_(this) {
|
| if (!delay_initialization)
|
| Init();
|
| }
|
|
|
| TestURLRequestContext::~TestURLRequestContext() {
|
| DCHECK(initialized_);
|
| AssertNoURLRequests();
|
| }
|
|
|
| @@ -92,46 +94,48 @@ void TestURLRequestContext::Init() {
|
| }
|
| if (!http_server_properties()) {
|
| context_storage_.set_http_server_properties(
|
| scoped_ptr<HttpServerProperties>(new HttpServerPropertiesImpl()));
|
| }
|
| if (http_transaction_factory()) {
|
| // Make sure we haven't been passed an object we're not going to use.
|
| EXPECT_FALSE(client_socket_factory_);
|
| } else {
|
| HttpNetworkSession::Params params;
|
| +
|
| if (http_network_session_params_)
|
| params = *http_network_session_params_;
|
| params.client_socket_factory = client_socket_factory();
|
| + params.proxy_delegate = proxy_delegate();
|
| params.host_resolver = host_resolver();
|
| params.cert_verifier = cert_verifier();
|
| params.transport_security_state = transport_security_state();
|
| params.proxy_service = proxy_service();
|
| params.ssl_config_service = ssl_config_service();
|
| params.http_auth_handler_factory = http_auth_handler_factory();
|
| params.network_delegate = network_delegate();
|
| params.http_server_properties = http_server_properties();
|
| params.net_log = net_log();
|
| params.channel_id_service = channel_id_service();
|
| context_storage_.set_http_network_session(
|
| make_scoped_ptr(new HttpNetworkSession(params)));
|
| context_storage_.set_http_transaction_factory(make_scoped_ptr(
|
| new HttpCache(context_storage_.http_network_session(),
|
| HttpCache::DefaultBackend::InMemory(0), false)));
|
| }
|
| // In-memory cookie store.
|
| if (!cookie_store())
|
| - context_storage_.set_cookie_store(new CookieMonster(NULL, NULL));
|
| + context_storage_.set_cookie_store(new CookieMonster(nullptr, nullptr));
|
| // In-memory Channel ID service.
|
| if (!channel_id_service()) {
|
| context_storage_.set_channel_id_service(make_scoped_ptr(
|
| - new ChannelIDService(new DefaultChannelIDStore(NULL),
|
| + new ChannelIDService(new DefaultChannelIDStore(nullptr),
|
| base::WorkerPool::GetTaskRunner(true))));
|
| }
|
| if (!http_user_agent_settings()) {
|
| context_storage_.set_http_user_agent_settings(make_scoped_ptr(
|
| new StaticHttpUserAgentSettings("en-us,fr", std::string())));
|
| }
|
| if (!job_factory()) {
|
| context_storage_.set_job_factory(
|
| make_scoped_ptr(new URLRequestJobFactoryImpl()));
|
| }
|
|
|