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 <iterator> | 9 #include <iterator> |
10 #include <set> | 10 #include <set> |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
34 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
35 #include "components/pref_registry/pref_registry_syncable.h" | 35 #include "components/pref_registry/pref_registry_syncable.h" |
36 #include "components/prefs/pref_service.h" | 36 #include "components/prefs/pref_service.h" |
37 #include "components/prefs/scoped_user_pref_update.h" | 37 #include "components/prefs/scoped_user_pref_update.h" |
38 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
39 #include "content/public/browser/resource_hints.h" | 39 #include "content/public/browser/resource_hints.h" |
40 #include "net/base/address_list.h" | 40 #include "net/base/address_list.h" |
41 #include "net/base/completion_callback.h" | 41 #include "net/base/completion_callback.h" |
42 #include "net/base/host_port_pair.h" | 42 #include "net/base/host_port_pair.h" |
43 #include "net/base/load_flags.h" | |
44 #include "net/base/net_errors.h" | 43 #include "net/base/net_errors.h" |
45 #include "net/dns/host_resolver.h" | 44 #include "net/dns/host_resolver.h" |
46 #include "net/dns/single_request_host_resolver.h" | 45 #include "net/dns/single_request_host_resolver.h" |
47 #include "net/http/transport_security_state.h" | 46 #include "net/http/transport_security_state.h" |
48 #include "net/log/net_log.h" | 47 #include "net/log/net_log.h" |
49 #include "net/proxy/proxy_info.h" | 48 #include "net/proxy/proxy_info.h" |
50 #include "net/proxy/proxy_service.h" | 49 #include "net/proxy/proxy_service.h" |
51 #include "net/ssl/ssl_config_service.h" | 50 #include "net/ssl/ssl_config_service.h" |
52 #include "net/url_request/url_request_context.h" | 51 #include "net/url_request/url_request_context.h" |
53 #include "net/url_request/url_request_context_getter.h" | 52 #include "net/url_request/url_request_context_getter.h" |
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 info->SetNoSuchNameState(); | 953 info->SetNoSuchNameState(); |
955 } | 954 } |
956 } | 955 } |
957 | 956 |
958 bool Predictor::WouldLikelyProxyURL(const GURL& url) { | 957 bool Predictor::WouldLikelyProxyURL(const GURL& url) { |
959 if (!proxy_service_) | 958 if (!proxy_service_) |
960 return false; | 959 return false; |
961 | 960 |
962 net::ProxyInfo info; | 961 net::ProxyInfo info; |
963 bool synchronous_success = proxy_service_->TryResolveProxySynchronously( | 962 bool synchronous_success = proxy_service_->TryResolveProxySynchronously( |
964 url, std::string(), net::LOAD_NORMAL, &info, nullptr, net::BoundNetLog()); | 963 url, std::string(), &info, nullptr, net::BoundNetLog()); |
965 | 964 |
966 return synchronous_success && !info.is_direct(); | 965 return synchronous_success && !info.is_direct(); |
967 } | 966 } |
968 | 967 |
969 UrlInfo* Predictor::AppendToResolutionQueue( | 968 UrlInfo* Predictor::AppendToResolutionQueue( |
970 const GURL& url, | 969 const GURL& url, |
971 UrlInfo::ResolutionMotivation motivation) { | 970 UrlInfo::ResolutionMotivation motivation) { |
972 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 971 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
973 DCHECK(url.has_host()); | 972 DCHECK(url.has_host()); |
974 | 973 |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 } | 1224 } |
1226 | 1225 |
1227 void SimplePredictor::ShutdownOnUIThread() { | 1226 void SimplePredictor::ShutdownOnUIThread() { |
1228 SetShutdown(true); | 1227 SetShutdown(true); |
1229 } | 1228 } |
1230 | 1229 |
1231 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; } | 1230 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; } |
1232 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; } | 1231 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; } |
1233 | 1232 |
1234 } // namespace chrome_browser_net | 1233 } // namespace chrome_browser_net |
OLD | NEW |