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

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

Issue 6166010: net: Remove typedef net::URLRequestStatus URLRequestStatus; (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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) 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 "chrome/browser/intranet_redirect_detector.h" 5 #include "chrome/browser/intranet_redirect_detector.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/stl_util-inl.h" 9 #include "base/stl_util-inl.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 net::LOAD_DO_NOT_SAVE_COOKIES); 100 net::LOAD_DO_NOT_SAVE_COOKIES);
101 fetcher->set_request_context(Profile::GetDefaultRequestContext()); 101 fetcher->set_request_context(Profile::GetDefaultRequestContext());
102 fetcher->Start(); 102 fetcher->Start();
103 fetchers_.insert(fetcher); 103 fetchers_.insert(fetcher);
104 } 104 }
105 } 105 }
106 106
107 void IntranetRedirectDetector::OnURLFetchComplete( 107 void IntranetRedirectDetector::OnURLFetchComplete(
108 const URLFetcher* source, 108 const URLFetcher* source,
109 const GURL& url, 109 const GURL& url,
110 const URLRequestStatus& status, 110 const net::URLRequestStatus& status,
111 int response_code, 111 int response_code,
112 const ResponseCookies& cookies, 112 const ResponseCookies& cookies,
113 const std::string& data) { 113 const std::string& data) {
114 // Delete the fetcher on this function's exit. 114 // Delete the fetcher on this function's exit.
115 Fetchers::iterator fetcher = fetchers_.find(const_cast<URLFetcher*>(source)); 115 Fetchers::iterator fetcher = fetchers_.find(const_cast<URLFetcher*>(source));
116 DCHECK(fetcher != fetchers_.end()); 116 DCHECK(fetcher != fetchers_.end());
117 scoped_ptr<URLFetcher> clean_up_fetcher(*fetcher); 117 scoped_ptr<URLFetcher> clean_up_fetcher(*fetcher);
118 fetchers_.erase(fetcher); 118 fetchers_.erase(fetcher);
119 119
120 // If any two fetches result in the same domain/host, we set the redirect 120 // If any two fetches result in the same domain/host, we set the redirect
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // the same thread. So just use the heuristic that any all-lowercase a-z 196 // the same thread. So just use the heuristic that any all-lowercase a-z
197 // hostname with the right number of characters is likely from the detector 197 // hostname with the right number of characters is likely from the detector
198 // (and thus should be blocked). 198 // (and thus should be blocked).
199 return ((host.length() == IntranetRedirectDetector::kNumCharsInHostnames) && 199 return ((host.length() == IntranetRedirectDetector::kNumCharsInHostnames) &&
200 (host.find_first_not_of("abcdefghijklmnopqrstuvwxyz") == 200 (host.find_first_not_of("abcdefghijklmnopqrstuvwxyz") ==
201 std::string::npos)) ? 201 std::string::npos)) ?
202 net::ERR_NAME_NOT_RESOLVED : 202 net::ERR_NAME_NOT_RESOLVED :
203 ResolveUsingPrevious(host, address_family, host_resolver_flags, addrlist, 203 ResolveUsingPrevious(host, address_family, host_resolver_flags, addrlist,
204 os_error); 204 os_error);
205 } 205 }
OLDNEW
« no previous file with comments | « chrome/browser/google/google_url_tracker_unittest.cc ('k') | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698