summaryrefslogtreecommitdiffstats
path: root/net/url_request
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-27 01:50:14 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-27 01:50:14 +0000
commit94a0d3d91b7200e66a4d23bb49b38cae7e74f7db (patch)
tree7f6b01af9e6e2a741dc4938d8e524be9f277aa3a /net/url_request
parentafef5e483bc3782ecaf2572493442e0a2bd22bac (diff)
downloadchromium_src-94a0d3d91b7200e66a4d23bb49b38cae7e74f7db.zip
chromium_src-94a0d3d91b7200e66a4d23bb49b38cae7e74f7db.tar.gz
chromium_src-94a0d3d91b7200e66a4d23bb49b38cae7e74f7db.tar.bz2
Make net::HostResolver refcounted.
This way it can be properly shared between the url request contexts, and the dns prefetcher, and dns observer. BUG=http://crbug.com/14664 TEST=existing unit tests. Review URL: http://codereview.chromium.org/149053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19451 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r--net/url_request/url_request_context.h4
-rw-r--r--net/url_request/url_request_unittest.cc1
-rw-r--r--net/url_request/url_request_unittest.h6
3 files changed, 3 insertions, 8 deletions
diff --git a/net/url_request/url_request_context.h b/net/url_request/url_request_context.h
index 374af90..486ade0 100644
--- a/net/url_request/url_request_context.h
+++ b/net/url_request/url_request_context.h
@@ -13,13 +13,13 @@
#include "base/ref_counted.h"
#include "base/string_util.h"
#include "net/base/cookie_policy.h"
+#include "net/base/host_resolver.h"
#include "net/ftp/ftp_auth_cache.h"
namespace net {
class CookieMonster;
class ForceTLSState;
class FtpTransactionFactory;
-class HostResolver;
class HttpTransactionFactory;
class ProxyService;
}
@@ -113,7 +113,7 @@ class URLRequestContext :
// The following members are expected to be initialized and owned by
// subclasses.
- net::HostResolver* host_resolver_;
+ scoped_refptr<net::HostResolver> host_resolver_;
net::ProxyService* proxy_service_;
net::HttpTransactionFactory* http_transaction_factory_;
net::FtpTransactionFactory* ftp_transaction_factory_;
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index f5452be..415fb1c 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -59,7 +59,6 @@ class URLRequestHttpCacheContext : public URLRequestContext {
delete cookie_store_;
delete http_transaction_factory_;
delete proxy_service_;
- delete host_resolver_;
}
};
diff --git a/net/url_request/url_request_unittest.h b/net/url_request/url_request_unittest.h
index a4ec2fe..dcc1757 100644
--- a/net/url_request/url_request_unittest.h
+++ b/net/url_request/url_request_unittest.h
@@ -51,10 +51,7 @@ class TestURLRequestContext : public URLRequestContext {
}
explicit TestURLRequestContext(const std::string& proxy) {
- // TODO(eroman): we turn off host caching to see if synchronous
- // host resolving interacts poorly with client socket pool. [experiment]
- // http://crbug.com/13952
- host_resolver_ = new net::HostResolver(0, 0);
+ host_resolver_ = new net::HostResolver;
net::ProxyConfig proxy_config;
proxy_config.proxy_rules.ParseFromString(proxy);
proxy_service_ = net::ProxyService::CreateFixed(proxy_config);
@@ -66,7 +63,6 @@ class TestURLRequestContext : public URLRequestContext {
virtual ~TestURLRequestContext() {
delete http_transaction_factory_;
delete proxy_service_;
- delete host_resolver_;
}
};