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

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

Issue 9721002: [net/dns] Removes locking from DnsConfigServiceWin and adds local computer name. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Responded to review. Added normalization and comments. Created 8 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/dns/dns_config_service.h » ('j') | net/dns/dns_config_service_win.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after
1799 const RequestInfo& info) const { 1799 const RequestInfo& info) const {
1800 HostResolverFlags effective_flags = 1800 HostResolverFlags effective_flags =
1801 info.host_resolver_flags() | additional_resolver_flags_; 1801 info.host_resolver_flags() | additional_resolver_flags_;
1802 AddressFamily effective_address_family = info.address_family(); 1802 AddressFamily effective_address_family = info.address_family();
1803 if (effective_address_family == ADDRESS_FAMILY_UNSPECIFIED && 1803 if (effective_address_family == ADDRESS_FAMILY_UNSPECIFIED &&
1804 default_address_family_ != ADDRESS_FAMILY_UNSPECIFIED) { 1804 default_address_family_ != ADDRESS_FAMILY_UNSPECIFIED) {
1805 effective_address_family = default_address_family_; 1805 effective_address_family = default_address_family_;
1806 if (ipv6_probe_monitoring_) 1806 if (ipv6_probe_monitoring_)
1807 effective_flags |= HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6; 1807 effective_flags |= HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6;
1808 } 1808 }
1809 return Key(info.hostname(), effective_address_family, effective_flags); 1809 return Key(StringToLowerASCII(info.hostname()),
mmenke 2012/03/22 19:36:08 May want to have a unit test that depends on this.
cbentzel 2012/03/22 19:45:15 I'm not sure you want to do this here. It looks li
mmenke 2012/03/22 19:55:09 Err...wait...Doesn't GURL automatically lowercase
mmenke 2012/03/22 19:58:36 Domains used by PAC script don't go through a GURL
1810 effective_address_family,
1811 effective_flags);
1810 } 1812 }
1811 1813
1812 void HostResolverImpl::AbortAllInProgressJobs() { 1814 void HostResolverImpl::AbortAllInProgressJobs() {
1813 // In Abort, a Request callback could spawn new Jobs with matching keys, so 1815 // In Abort, a Request callback could spawn new Jobs with matching keys, so
1814 // first collect and remove all running jobs from |jobs_|. 1816 // first collect and remove all running jobs from |jobs_|.
1815 std::vector<Job*> jobs_to_abort; 1817 std::vector<Job*> jobs_to_abort;
1816 for (JobMap::iterator it = jobs_.begin(); it != jobs_.end(); ) { 1818 for (JobMap::iterator it = jobs_.begin(); it != jobs_.end(); ) {
1817 Job* job = it->second; 1819 Job* job = it->second;
1818 if (job->is_running()) { 1820 if (job->is_running()) {
1819 jobs_to_abort.push_back(job); 1821 jobs_to_abort.push_back(job);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1910 1912
1911 if (self && dns_config.IsValid()) 1913 if (self && dns_config.IsValid())
1912 TryServingAllJobsFromHosts(); 1914 TryServingAllJobsFromHosts();
1913 } 1915 }
1914 1916
1915 bool HostResolverImpl::HaveDnsConfig() const { 1917 bool HostResolverImpl::HaveDnsConfig() const {
1916 return (dns_client_.get() != NULL) && (dns_client_->GetConfig() != NULL); 1918 return (dns_client_.get() != NULL) && (dns_client_->GetConfig() != NULL);
1917 } 1919 }
1918 1920
1919 } // namespace net 1921 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/dns/dns_config_service.h » ('j') | net/dns/dns_config_service_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698