OLD | NEW |
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 "chrome/browser/net/predictor.h" | 5 #include "chrome/browser/net/predictor.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <set> | 9 #include <set> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 info->SetNoSuchNameState(); | 1009 info->SetNoSuchNameState(); |
1010 } | 1010 } |
1011 } | 1011 } |
1012 | 1012 |
1013 bool Predictor::WouldLikelyProxyURL(const GURL& url) { | 1013 bool Predictor::WouldLikelyProxyURL(const GURL& url) { |
1014 if (!proxy_service_) | 1014 if (!proxy_service_) |
1015 return false; | 1015 return false; |
1016 | 1016 |
1017 net::ProxyInfo info; | 1017 net::ProxyInfo info; |
1018 bool synchronous_success = proxy_service_->TryResolveProxySynchronously( | 1018 bool synchronous_success = proxy_service_->TryResolveProxySynchronously( |
1019 url, net::LOAD_NORMAL, &info, NULL, net::BoundNetLog()); | 1019 url, std::string(), net::LOAD_NORMAL, &info, NULL, net::BoundNetLog()); |
1020 | 1020 |
1021 return synchronous_success && !info.is_direct(); | 1021 return synchronous_success && !info.is_direct(); |
1022 } | 1022 } |
1023 | 1023 |
1024 UrlInfo* Predictor::AppendToResolutionQueue( | 1024 UrlInfo* Predictor::AppendToResolutionQueue( |
1025 const GURL& url, | 1025 const GURL& url, |
1026 UrlInfo::ResolutionMotivation motivation) { | 1026 UrlInfo::ResolutionMotivation motivation) { |
1027 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1027 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
1028 DCHECK(url.has_host()); | 1028 DCHECK(url.has_host()); |
1029 | 1029 |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1305 } | 1305 } |
1306 | 1306 |
1307 void SimplePredictor::ShutdownOnUIThread() { | 1307 void SimplePredictor::ShutdownOnUIThread() { |
1308 SetShutdown(true); | 1308 SetShutdown(true); |
1309 } | 1309 } |
1310 | 1310 |
1311 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; } | 1311 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; } |
1312 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; } | 1312 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; } |
1313 | 1313 |
1314 } // namespace chrome_browser_net | 1314 } // namespace chrome_browser_net |
OLD | NEW |