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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 params.http_server_properties = http_server_properties(); | 116 params.http_server_properties = http_server_properties(); |
117 params.net_log = net_log(); | 117 params.net_log = net_log(); |
118 params.channel_id_service = channel_id_service(); | 118 params.channel_id_service = channel_id_service(); |
119 context_storage_.set_http_network_session( | 119 context_storage_.set_http_network_session( |
120 make_scoped_ptr(new HttpNetworkSession(params))); | 120 make_scoped_ptr(new HttpNetworkSession(params))); |
121 context_storage_.set_http_transaction_factory(make_scoped_ptr( | 121 context_storage_.set_http_transaction_factory(make_scoped_ptr( |
122 new HttpCache(context_storage_.http_network_session(), | 122 new HttpCache(context_storage_.http_network_session(), |
123 HttpCache::DefaultBackend::InMemory(0), false))); | 123 HttpCache::DefaultBackend::InMemory(0), false))); |
124 } | 124 } |
125 // In-memory cookie store. | 125 // In-memory cookie store. |
126 if (!cookie_store()) | 126 if (!cookie_store()) { |
127 context_storage_.set_cookie_store(new CookieMonster(nullptr, nullptr)); | 127 context_storage_.set_cookie_store( |
| 128 make_scoped_ptr(new CookieMonster(nullptr, nullptr))); |
| 129 } |
128 // In-memory Channel ID service. | 130 // In-memory Channel ID service. |
129 if (!channel_id_service()) { | 131 if (!channel_id_service()) { |
130 context_storage_.set_channel_id_service(make_scoped_ptr( | 132 context_storage_.set_channel_id_service(make_scoped_ptr( |
131 new ChannelIDService(new DefaultChannelIDStore(nullptr), | 133 new ChannelIDService(new DefaultChannelIDStore(nullptr), |
132 base::WorkerPool::GetTaskRunner(true)))); | 134 base::WorkerPool::GetTaskRunner(true)))); |
133 } | 135 } |
134 if (!http_user_agent_settings()) { | 136 if (!http_user_agent_settings()) { |
135 context_storage_.set_http_user_agent_settings(make_scoped_ptr( | 137 context_storage_.set_http_user_agent_settings(make_scoped_ptr( |
136 new StaticHttpUserAgentSettings("en-us,fr", std::string()))); | 138 new StaticHttpUserAgentSettings("en-us,fr", std::string()))); |
137 } | 139 } |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 URLRequest* request, | 655 URLRequest* request, |
654 NetworkDelegate* network_delegate) const { | 656 NetworkDelegate* network_delegate) const { |
655 return main_intercept_job_.release(); | 657 return main_intercept_job_.release(); |
656 } | 658 } |
657 | 659 |
658 void TestJobInterceptor::set_main_intercept_job(scoped_ptr<URLRequestJob> job) { | 660 void TestJobInterceptor::set_main_intercept_job(scoped_ptr<URLRequestJob> job) { |
659 main_intercept_job_ = std::move(job); | 661 main_intercept_job_ = std::move(job); |
660 } | 662 } |
661 | 663 |
662 } // namespace net | 664 } // namespace net |
OLD | NEW |