summaryrefslogtreecommitdiffstats
path: root/webkit/tools
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-12 00:49:38 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-12 00:49:38 +0000
commit8a00f00ab5d68ffcc998fd04d2ca343af7cdf190 (patch)
treefd464ba49db4271c76c1cf8f769a22120ad631af /webkit/tools
parent77ae132c1bfdd986228b6f1c0d8c63baa441afdf (diff)
downloadchromium_src-8a00f00ab5d68ffcc998fd04d2ca343af7cdf190.zip
chromium_src-8a00f00ab5d68ffcc998fd04d2ca343af7cdf190.tar.gz
chromium_src-8a00f00ab5d68ffcc998fd04d2ca343af7cdf190.tar.bz2
* Avoid doing concurrent DNS resolves of the same hostname in HostResolver.
* Add a 1 minute cache for host resolves. * Refactor HostResolver to handle multiple requests. * Make HostResolver a dependency of URLRequestContext. operate the HostResolver in async mode for proxy resolver (bridging to IO thread). TEST=unittests BUG=13163 Review URL: http://codereview.chromium.org/118100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18236 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r--webkit/tools/test_shell/test_shell_request_context.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/webkit/tools/test_shell/test_shell_request_context.cc b/webkit/tools/test_shell/test_shell_request_context.cc
index a1651df..e007cc6 100644
--- a/webkit/tools/test_shell/test_shell_request_context.cc
+++ b/webkit/tools/test_shell/test_shell_request_context.cc
@@ -5,6 +5,7 @@
#include "webkit/tools/test_shell/test_shell_request_context.h"
#include "net/base/cookie_monster.h"
+#include "net/base/host_resolver.h"
#include "net/proxy/proxy_service.h"
#include "webkit/glue/webkit_glue.h"
@@ -41,14 +42,15 @@ void TestShellRequestContext::Init(
// issues.
no_proxy = true;
#endif
+ host_resolver_ = new net::HostResolver();
proxy_service_ = net::ProxyService::Create(no_proxy ? &proxy_config : NULL,
false, NULL, NULL);
net::HttpCache *cache;
if (cache_path.empty()) {
- cache = new net::HttpCache(proxy_service_, 0);
+ cache = new net::HttpCache(host_resolver_, proxy_service_, 0);
} else {
- cache = new net::HttpCache(proxy_service_, cache_path, 0);
+ cache = new net::HttpCache(host_resolver_, proxy_service_, cache_path, 0);
}
cache->set_mode(cache_mode);
http_transaction_factory_ = cache;
@@ -58,6 +60,7 @@ TestShellRequestContext::~TestShellRequestContext() {
delete cookie_store_;
delete http_transaction_factory_;
delete proxy_service_;
+ delete host_resolver_;
}
const std::string& TestShellRequestContext::GetUserAgent(