Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(797)

Unified Diff: net/url_request/url_request_test_util.cc

Issue 1680893002: Moving proxy resolution logic out of NetworkDelegate and into ProxyDelegate for DataReductionProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/url_request_test_util.h ('k') | net/websockets/websocket_end_to_end_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()));
}
« no previous file with comments | « net/url_request/url_request_test_util.h ('k') | net/websockets/websocket_end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698