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

Side by Side Diff: net/base/host_resolver_impl.cc

Issue 8429034: Upstream: Build net_unittests for Android. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: address comments Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/host_resolver_impl.h" 5 #include "net/base/host_resolver_impl.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <Winsock2.h> 8 #include <Winsock2.h>
9 #elif defined(OS_POSIX) 9 #elif defined(OS_POSIX)
10 #include <netdb.h> 10 #include <netdb.h>
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 if (max_retry_attempts_ == HostResolver::kDefaultRetryAttempts) 1078 if (max_retry_attempts_ == HostResolver::kDefaultRetryAttempts)
1079 max_retry_attempts_ = kDefaultMaxRetryAttempts; 1079 max_retry_attempts_ = kDefaultMaxRetryAttempts;
1080 1080
1081 // It is cumbersome to expose all of the constraints in the constructor, 1081 // It is cumbersome to expose all of the constraints in the constructor,
1082 // so we choose some defaults, which users can override later. 1082 // so we choose some defaults, which users can override later.
1083 job_pools_[POOL_NORMAL] = new JobPool(max_jobs, 100u * max_jobs); 1083 job_pools_[POOL_NORMAL] = new JobPool(max_jobs, 100u * max_jobs);
1084 1084
1085 #if defined(OS_WIN) 1085 #if defined(OS_WIN)
1086 EnsureWinsockInit(); 1086 EnsureWinsockInit();
1087 #endif 1087 #endif
1088 #if defined(OS_POSIX) && !defined(OS_MACOSX) 1088 #if defined(OS_POSIX) && !defined(OS_MACOSX)
joth 2011/11/02 18:57:05 ISTM this #if clause should match the one below: i
1089 if (HaveOnlyLoopbackAddresses()) 1089 if (HaveOnlyLoopbackAddresses())
1090 additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY; 1090 additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY;
1091 #endif 1091 #endif
1092 NetworkChangeNotifier::AddIPAddressObserver(this); 1092 NetworkChangeNotifier::AddIPAddressObserver(this);
1093 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) 1093 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && !defined (OS_ANDROID)
joth 2011/11/02 18:57:05 nit: word wrap
Jing Zhao 2011/11/03 17:49:08 Just found I only want to skip EnsureDnsReloaderIn
1094 EnsureDnsReloaderInit(); 1094 EnsureDnsReloaderInit();
1095 NetworkChangeNotifier::AddDNSObserver(this); 1095 NetworkChangeNotifier::AddDNSObserver(this);
1096 #endif 1096 #endif
1097 } 1097 }
1098 1098
1099 HostResolverImpl::~HostResolverImpl() { 1099 HostResolverImpl::~HostResolverImpl() {
1100 // Cancel the outstanding jobs. Those jobs may contain several attached 1100 // Cancel the outstanding jobs. Those jobs may contain several attached
1101 // requests, which will also be cancelled. 1101 // requests, which will also be cancelled.
1102 DiscardIPv6ProbeJob(); 1102 DiscardIPv6ProbeJob();
1103 1103
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
1654 // resolv.conf changes so we don't need to do anything to clear that cache. 1654 // resolv.conf changes so we don't need to do anything to clear that cache.
1655 if (cache_.get()) 1655 if (cache_.get())
1656 cache_->clear(); 1656 cache_->clear();
1657 // Existing jobs will have been sent to the original server so they need to 1657 // Existing jobs will have been sent to the original server so they need to
1658 // be aborted. TODO(Craig): Should these jobs be restarted? 1658 // be aborted. TODO(Craig): Should these jobs be restarted?
1659 AbortAllInProgressJobs(); 1659 AbortAllInProgressJobs();
1660 // |this| may be deleted inside AbortAllInProgressJobs(). 1660 // |this| may be deleted inside AbortAllInProgressJobs().
1661 } 1661 }
1662 1662
1663 } // namespace net 1663 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698