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

Unified Diff: chrome/browser/net/connection_tester.cc

Issue 10831277: [net] Change factory methods for HostResolver and HostCache to return a scoped_ptr (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add ChromeBrowserFieldTrials::AsyncDnsFieldTrial Created 8 years, 4 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
Index: chrome/browser/net/connection_tester.cc
diff --git a/chrome/browser/net/connection_tester.cc b/chrome/browser/net/connection_tester.cc
index 2303acae4903f00aacfec5561d7c6d385a742c7f..fba6938c6eeb3a47cc644e5517cf69d2af3c254d 100644
--- a/chrome/browser/net/connection_tester.cc
+++ b/chrome/browser/net/connection_tester.cc
@@ -142,19 +142,19 @@ class ExperimentURLRequestContext : public net::URLRequestContext {
// Create a vanilla HostResolver that disables caching.
const size_t kMaxJobs = 50u;
const size_t kMaxRetryAttempts = 4u;
- net::HostResolver* impl = net::CreateNonCachingSystemHostResolver(
+ *host_resolver = net::HostResolver::CreateSystemResolver(
kMaxJobs,
kMaxRetryAttempts,
+ false /* use_cache */,
+ false /* use_async */,
NULL /* NetLog */);
- host_resolver->reset(impl);
-
// Modify it slightly based on the experiment being run.
switch (experiment) {
case ConnectionTester::HOST_RESOLVER_EXPERIMENT_PLAIN:
return net::OK;
case ConnectionTester::HOST_RESOLVER_EXPERIMENT_DISABLE_IPV6:
- impl->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4);
+ (*host_resolver)->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4);
return net::OK;
case ConnectionTester::HOST_RESOLVER_EXPERIMENT_IPV6_PROBE: {
// Note that we don't use impl->ProbeIPv6Support() since that finishes
@@ -162,7 +162,7 @@ class ExperimentURLRequestContext : public net::URLRequestContext {
// So instead we will probe synchronously (might take 100-200 ms).
net::AddressFamily family = net::TestIPv6Support().ipv6_supported ?
net::ADDRESS_FAMILY_UNSPECIFIED : net::ADDRESS_FAMILY_IPV4;
- impl->SetDefaultAddressFamily(family);
+ (*host_resolver)->SetDefaultAddressFamily(family);
return net::OK;
}
default:

Powered by Google App Engine
This is Rietveld 408576698