Chromium Code Reviews| 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 // A Predictor object is instantiated once in the browser process, and manages | 5 // A Predictor object is instantiated once in the browser process, and manages |
| 6 // both preresolution of hostnames, as well as TCP/IP preconnection to expected | 6 // both preresolution of hostnames, as well as TCP/IP preconnection to expected |
| 7 // subresources. | 7 // subresources. |
| 8 // Most hostname lists are provided by the renderer processes, and include URLs | 8 // Most hostname lists are provided by the renderer processes, and include URLs |
| 9 // that *might* be used in the near future by the browsing user. One goal of | 9 // that *might* be used in the near future by the browsing user. One goal of |
| 10 // this class is to cause the underlying DNS structure to lookup a hostname | 10 // this class is to cause the underlying DNS structure to lookup a hostname |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 #include <vector> | 26 #include <vector> |
| 27 | 27 |
| 28 #include "base/gtest_prod_util.h" | 28 #include "base/gtest_prod_util.h" |
| 29 #include "base/memory/scoped_ptr.h" | 29 #include "base/memory/scoped_ptr.h" |
| 30 #include "base/memory/weak_ptr.h" | 30 #include "base/memory/weak_ptr.h" |
| 31 #include "chrome/browser/net/prediction_options.h" | 31 #include "chrome/browser/net/prediction_options.h" |
| 32 #include "chrome/browser/net/referrer.h" | 32 #include "chrome/browser/net/referrer.h" |
| 33 #include "chrome/browser/net/spdyproxy/proxy_advisor.h" | 33 #include "chrome/browser/net/spdyproxy/proxy_advisor.h" |
| 34 #include "chrome/browser/net/timed_cache.h" | 34 #include "chrome/browser/net/timed_cache.h" |
| 35 #include "chrome/browser/net/url_info.h" | 35 #include "chrome/browser/net/url_info.h" |
| 36 #include "chrome/common/net/predictor_common.h" | 36 #include "components/predictor/common/predictor_common.h" |
|
Nico
2014/10/28 20:07:19
is "predictor" the best name if this is just in co
gunsch
2014/10/28 20:47:32
Sounds like a +1 to blundell's idea, so renaming t
| |
| 37 #include "net/base/host_port_pair.h" | 37 #include "net/base/host_port_pair.h" |
| 38 | 38 |
| 39 class IOThread; | 39 class IOThread; |
| 40 class PrefService; | 40 class PrefService; |
| 41 class Profile; | 41 class Profile; |
| 42 class ProfileIOData; | 42 class ProfileIOData; |
| 43 | 43 |
| 44 namespace base { | 44 namespace base { |
| 45 class ListValue; | 45 class ListValue; |
| 46 class WaitableEvent; | 46 class WaitableEvent; |
| 47 } | 47 } |
| 48 | 48 |
| 49 namespace net { | 49 namespace net { |
| 50 class HostResolver; | 50 class HostResolver; |
| 51 class SSLConfigService; | 51 class SSLConfigService; |
| 52 class ProxyService; | 52 class ProxyService; |
| 53 class TransportSecurityState; | 53 class TransportSecurityState; |
| 54 class URLRequestContextGetter; | 54 class URLRequestContextGetter; |
| 55 } | 55 } |
| 56 | 56 |
| 57 namespace user_prefs { | 57 namespace user_prefs { |
| 58 class PrefRegistrySyncable; | 58 class PrefRegistrySyncable; |
| 59 } | 59 } |
| 60 | 60 |
| 61 namespace chrome_browser_net { | 61 namespace chrome_browser_net { |
| 62 | 62 |
| 63 typedef chrome_common_net::UrlList UrlList; | 63 typedef predictor::UrlList UrlList; |
| 64 typedef chrome_common_net::NameList NameList; | 64 typedef predictor::NameList NameList; |
| 65 typedef std::map<GURL, UrlInfo> Results; | 65 typedef std::map<GURL, UrlInfo> Results; |
| 66 | 66 |
| 67 // An observer for testing. | 67 // An observer for testing. |
| 68 class PredictorObserver { | 68 class PredictorObserver { |
| 69 public: | 69 public: |
| 70 virtual ~PredictorObserver() {} | 70 virtual ~PredictorObserver() {} |
| 71 | 71 |
| 72 virtual void OnPreconnectUrl(const GURL& original_url, | 72 virtual void OnPreconnectUrl(const GURL& original_url, |
| 73 const GURL& first_party_for_cookies, | 73 const GURL& first_party_for_cookies, |
| 74 UrlInfo::ResolutionMotivation motivation, | 74 UrlInfo::ResolutionMotivation motivation, |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 629 | 629 |
| 630 private: | 630 private: |
| 631 // These member functions return True for unittests. | 631 // These member functions return True for unittests. |
| 632 bool CanPrefetchAndPrerender() const override; | 632 bool CanPrefetchAndPrerender() const override; |
| 633 bool CanPreresolveAndPreconnect() const override; | 633 bool CanPreresolveAndPreconnect() const override; |
| 634 }; | 634 }; |
| 635 | 635 |
| 636 } // namespace chrome_browser_net | 636 } // namespace chrome_browser_net |
| 637 | 637 |
| 638 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ | 638 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ |
| OLD | NEW |