| 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 11 matching lines...) Expand all Loading... |
| 22 #include <stddef.h> | 22 #include <stddef.h> |
| 23 #include <stdint.h> | 23 #include <stdint.h> |
| 24 | 24 |
| 25 #include <map> | 25 #include <map> |
| 26 #include <memory> | 26 #include <memory> |
| 27 #include <queue> | 27 #include <queue> |
| 28 #include <string> | 28 #include <string> |
| 29 #include <vector> | 29 #include <vector> |
| 30 | 30 |
| 31 #include "base/containers/mru_cache.h" | 31 #include "base/containers/mru_cache.h" |
| 32 #include "base/feature_list.h" |
| 32 #include "base/gtest_prod_util.h" | 33 #include "base/gtest_prod_util.h" |
| 33 #include "base/macros.h" | 34 #include "base/macros.h" |
| 34 #include "base/memory/weak_ptr.h" | 35 #include "base/memory/weak_ptr.h" |
| 35 #include "chrome/browser/net/prediction_options.h" | 36 #include "chrome/browser/net/prediction_options.h" |
| 36 #include "chrome/browser/net/referrer.h" | 37 #include "chrome/browser/net/referrer.h" |
| 37 #include "chrome/browser/net/timed_cache.h" | 38 #include "chrome/browser/net/timed_cache.h" |
| 38 #include "chrome/browser/net/url_info.h" | 39 #include "chrome/browser/net/url_info.h" |
| 39 #include "components/network_hints/common/network_hints_common.h" | 40 #include "components/network_hints/common/network_hints_common.h" |
| 40 #include "net/base/host_port_pair.h" | 41 #include "net/base/host_port_pair.h" |
| 41 #include "url/gurl.h" | 42 #include "url/gurl.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 54 class SSLConfigService; | 55 class SSLConfigService; |
| 55 class ProxyService; | 56 class ProxyService; |
| 56 class TransportSecurityState; | 57 class TransportSecurityState; |
| 57 class URLRequestContextGetter; | 58 class URLRequestContextGetter; |
| 58 } | 59 } |
| 59 | 60 |
| 60 namespace user_prefs { | 61 namespace user_prefs { |
| 61 class PrefRegistrySyncable; | 62 class PrefRegistrySyncable; |
| 62 } | 63 } |
| 63 | 64 |
| 65 namespace features { |
| 66 extern const base::Feature kNetworkPrediction; |
| 67 } |
| 68 |
| 64 namespace chrome_browser_net { | 69 namespace chrome_browser_net { |
| 65 | 70 |
| 66 typedef std::map<GURL, UrlInfo> Results; | 71 typedef std::map<GURL, UrlInfo> Results; |
| 67 | 72 |
| 68 // An observer for testing. | 73 // An observer for testing. |
| 69 class PredictorObserver { | 74 class PredictorObserver { |
| 70 public: | 75 public: |
| 71 virtual ~PredictorObserver() {} | 76 virtual ~PredictorObserver() {} |
| 72 | 77 |
| 73 virtual void OnPreconnectUrl(const GURL& original_url, | 78 virtual void OnPreconnectUrl(const GURL& original_url, |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 | 566 |
| 562 private: | 567 private: |
| 563 // These member functions return True for unittests. | 568 // These member functions return True for unittests. |
| 564 bool CanPrefetchAndPrerender() const override; | 569 bool CanPrefetchAndPrerender() const override; |
| 565 bool CanPreresolveAndPreconnect() const override; | 570 bool CanPreresolveAndPreconnect() const override; |
| 566 }; | 571 }; |
| 567 | 572 |
| 568 } // namespace chrome_browser_net | 573 } // namespace chrome_browser_net |
| 569 | 574 |
| 570 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ | 575 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ |
| OLD | NEW |