summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-10 06:04:29 +0000
committerukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-10 06:04:29 +0000
commitf3ab072436ca57aa406687f566c22f337c4f0034 (patch)
tree7c40c0f07642bbdb734cc3560ac71e0464b060d6 /net
parentd7388b072ef3c4ed8f447098abd818fd6470f6e2 (diff)
downloadchromium_src-f3ab072436ca57aa406687f566c22f337c4f0034.zip
chromium_src-f3ab072436ca57aa406687f566c22f337c4f0034.tar.gz
chromium_src-f3ab072436ca57aa406687f566c22f337c4f0034.tar.bz2
Use URLRequestContext's host_resolver instead of SystemHostResolver.
For unittests, we can inject mock host_resolver via SetHostResolver(). BUG=none TEST=none Review URL: http://codereview.chromium.org/384001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31545 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/socket_stream/socket_stream.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc
index ccf32d0..fc8e77a 100644
--- a/net/socket_stream/socket_stream.cc
+++ b/net/socket_stream/socket_stream.cc
@@ -42,7 +42,6 @@ SocketStream::SocketStream(const GURL& url, Delegate* delegate)
delegate_(delegate),
max_pending_send_allowed_(kMaxPendingSendAllowed),
next_state_(STATE_NONE),
- host_resolver_(CreateSystemHostResolver()),
factory_(ClientSocketFactory::GetDefaultFactory()),
proxy_mode_(kDirectConnection),
pac_request_(NULL),
@@ -86,6 +85,7 @@ void SocketStream::SetUserData(const void* key, UserData* data) {
void SocketStream::set_context(URLRequestContext* context) {
context_ = context;
+ host_resolver_ = context_->host_resolver();
}
void SocketStream::Connect() {
@@ -416,6 +416,7 @@ int SocketStream::DoResolveHost() {
HostResolver::RequestInfo resolve_info(host, port);
+ DCHECK(host_resolver_.get());
resolver_.reset(new SingleRequestHostResolver(host_resolver_.get()));
return resolver_->Resolve(resolve_info, &addresses_, &io_callback_, NULL);
}