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

Side by Side Diff: chrome/browser/intranet_redirect_detector.cc

Issue 1629005: Revert 43826 - HostResolver now adds AI_CANONNAME to the hint flags if a requ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/intranet_redirect_detector.h" 5 #include "chrome/browser/intranet_redirect_detector.h"
6 6
7 #include "base/rand_util.h" 7 #include "base/rand_util.h"
8 #include "base/stl_util-inl.h" 8 #include "base/stl_util-inl.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 StartFetchesIfPossible(); 151 StartFetchesIfPossible();
152 } 152 }
153 153
154 IntranetRedirectHostResolverProc::IntranetRedirectHostResolverProc( 154 IntranetRedirectHostResolverProc::IntranetRedirectHostResolverProc(
155 net::HostResolverProc* previous) 155 net::HostResolverProc* previous)
156 : net::HostResolverProc(previous) { 156 : net::HostResolverProc(previous) {
157 } 157 }
158 158
159 int IntranetRedirectHostResolverProc::Resolve(const std::string& host, 159 int IntranetRedirectHostResolverProc::Resolve(const std::string& host,
160 net::AddressFamily address_family, 160 net::AddressFamily address_family,
161 net::HostResolverFlags flags,
162 net::AddressList* addrlist) { 161 net::AddressList* addrlist) {
163 // We'd love to just ask the IntranetRedirectDetector, but we may not be on 162 // We'd love to just ask the IntranetRedirectDetector, but we may not be on
164 // the same thread. So just use the heuristic that any all-lowercase a-z 163 // the same thread. So just use the heuristic that any all-lowercase a-z
165 // hostname with the right number of characters is likely from the detector 164 // hostname with the right number of characters is likely from the detector
166 // (and thus should be blocked). 165 // (and thus should be blocked).
167 return ((host.length() == IntranetRedirectDetector::kNumCharsInHostnames) && 166 return ((host.length() == IntranetRedirectDetector::kNumCharsInHostnames) &&
168 (host.find_first_not_of("abcdefghijklmnopqrstuvwxyz") == 167 (host.find_first_not_of("abcdefghijklmnopqrstuvwxyz") ==
169 std::string::npos)) ? 168 std::string::npos)) ?
170 net::ERR_NAME_NOT_RESOLVED : 169 net::ERR_NAME_NOT_RESOLVED :
171 ResolveUsingPrevious(host, address_family, flags, addrlist); 170 ResolveUsingPrevious(host, address_family, addrlist);
172 } 171 }
OLDNEW
« no previous file with comments | « chrome/browser/intranet_redirect_detector.h ('k') | chrome/browser/net/view_net_internals_job_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698