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

Unified Diff: net/dns/host_resolver.cc

Issue 238433003: Provide Shill IP Address to myIpAddress() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + feedback Created 6 years, 6 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
« no previous file with comments | « net/dns/host_resolver.h ('k') | net/dns/host_resolver_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/host_resolver.cc
diff --git a/net/dns/host_resolver.cc b/net/dns/host_resolver.cc
index 0435091a54f3d1291c8780ab3b22b0ac90c08236..147a5a6e2b8058c3f3f16f8adbfea6a8abc01ad1 100644
--- a/net/dns/host_resolver.cc
+++ b/net/dns/host_resolver.cc
@@ -24,10 +24,11 @@ namespace {
// that limit this to 6, so we're temporarily holding it at that level.
const size_t kDefaultMaxProcTasks = 6u;
-PrioritizedDispatcher::Limits GetDispatcherLimits(
- const HostResolver::Options& options) {
- PrioritizedDispatcher::Limits limits(NUM_PRIORITIES,
- options.max_concurrent_resolves);
+} // namespace
+
+PrioritizedDispatcher::Limits HostResolver::Options::GetDispatcherLimits()
+ const {
+ PrioritizedDispatcher::Limits limits(NUM_PRIORITIES, max_concurrent_resolves);
// If not using default, do not use the field trial.
if (limits.total_jobs != HostResolver::kDefaultParallelism)
@@ -82,8 +83,6 @@ PrioritizedDispatcher::Limits GetDispatcherLimits(
return limits;
}
-} // namespace
-
HostResolver::Options::Options()
: max_concurrent_resolves(kDefaultParallelism),
max_retry_attempts(kDefaultRetryAttempts),
@@ -116,22 +115,15 @@ base::Value* HostResolver::GetDnsConfigAsValue() const {
}
// static
-scoped_ptr<HostResolver>
-HostResolver::CreateSystemResolver(const Options& options, NetLog* net_log) {
- scoped_ptr<HostCache> cache;
- if (options.enable_caching)
- cache = HostCache::CreateDefaultCache();
- return scoped_ptr<HostResolver>(new HostResolverImpl(
- cache.Pass(),
- GetDispatcherLimits(options),
- HostResolverImpl::ProcTaskParams(NULL, options.max_retry_attempts),
- net_log));
+scoped_ptr<HostResolver> HostResolver::CreateSystemResolver(
+ const Options& options,
+ NetLog* net_log) {
+ return scoped_ptr<HostResolver>(new HostResolverImpl(options, net_log));
}
// static
-scoped_ptr<HostResolver>
-HostResolver::CreateDefaultResolver(NetLog* net_log) {
- return CreateSystemResolver(Options(), net_log);
+scoped_ptr<HostResolver> HostResolver::CreateDefaultResolver(NetLog* net_log) {
+ return scoped_ptr<HostResolver>(new HostResolverImpl(Options(), net_log));
}
HostResolver::HostResolver() {
« no previous file with comments | « net/dns/host_resolver.h ('k') | net/dns/host_resolver_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698