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

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: sync Created 8 years, 3 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 6940462be57df55a11efae341e1ca78963de3cb1..22cc46f7f5044cc725af6baf7c66420c55bbfd08 100644
--- a/chrome/browser/net/connection_tester.cc
+++ b/chrome/browser/net/connection_tester.cc
@@ -94,7 +94,7 @@ class ExperimentURLRequestContext : public net::URLRequestContext {
&host_resolver_tmp);
if (rv != net::OK)
return rv; // Failure.
- storage_.set_host_resolver(host_resolver_tmp.release());
+ storage_.set_host_resolver(host_resolver_tmp.Pass());
// Create a custom ProxyService for this this experiment.
scoped_ptr<net::ProxyService> experiment_proxy_service;
@@ -143,19 +143,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
@@ -163,7 +163,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