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" |
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 TransportSecurityState; | 52 class TransportSecurityState; |
53 class URLRequestContextGetter; | 53 class URLRequestContextGetter; |
54 } | 54 } |
55 | 55 |
56 namespace user_prefs { | 56 namespace user_prefs { |
57 class PrefRegistrySyncable; | 57 class PrefRegistrySyncable; |
58 } | 58 } |
59 | 59 |
60 namespace chrome_browser_net { | 60 namespace chrome_browser_net { |
61 | 61 |
62 typedef chrome_common_net::UrlList UrlList; | 62 typedef predictor::UrlList UrlList; |
63 typedef chrome_common_net::NameList NameList; | 63 typedef predictor::NameList NameList; |
64 typedef std::map<GURL, UrlInfo> Results; | 64 typedef std::map<GURL, UrlInfo> Results; |
65 | 65 |
66 // An observer for testing. | 66 // An observer for testing. |
67 class PredictorObserver { | 67 class PredictorObserver { |
68 public: | 68 public: |
69 virtual ~PredictorObserver() {} | 69 virtual ~PredictorObserver() {} |
70 | 70 |
71 virtual void OnPreconnectUrl(const GURL& original_url, | 71 virtual void OnPreconnectUrl(const GURL& original_url, |
72 const GURL& first_party_for_cookies, | 72 const GURL& first_party_for_cookies, |
73 UrlInfo::ResolutionMotivation motivation, | 73 UrlInfo::ResolutionMotivation motivation, |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 virtual void ShutdownOnUIThread() override; | 614 virtual void ShutdownOnUIThread() override; |
615 private: | 615 private: |
616 // These member functions return True for unittests. | 616 // These member functions return True for unittests. |
617 virtual bool CanPrefetchAndPrerender() const override; | 617 virtual bool CanPrefetchAndPrerender() const override; |
618 virtual bool CanPreresolveAndPreconnect() const override; | 618 virtual bool CanPreresolveAndPreconnect() const override; |
619 }; | 619 }; |
620 | 620 |
621 } // namespace chrome_browser_net | 621 } // namespace chrome_browser_net |
622 | 622 |
623 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ | 623 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ |
OLD | NEW |