| OLD | NEW |
| 1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2010 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 |
| 11 // before it is really needed, and hence reduce latency in the standard lookup | 11 // before it is really needed, and hence reduce latency in the standard lookup |
| 12 // paths. | 12 // paths. |
| 13 // Subresource relationships are usually acquired from the referrer field in a | 13 // Subresource relationships are usually acquired from the referrer field in a |
| 14 // navigation. A subresource URL may be associated with a referrer URL. Later | 14 // navigation. A subresource URL may be associated with a referrer URL. Later |
| 15 // navigations may, if the likelihood of needing the subresource is high enough, | 15 // navigations may, if the likelihood of needing the subresource is high enough, |
| 16 // cause this module to speculatively create a TCP/IP connection. If there is | 16 // cause this module to speculatively create a TCP/IP connection. If there is |
| 17 // only a low likelihood, then a DNS pre-resolution operation may be performed. | 17 // only a low likelihood, then a DNS pre-resolution operation may be performed. |
| 18 | 18 |
| 19 #ifndef CHROME_BROWSER_NET_PREDICTOR_H_ | 19 #ifndef CHROME_BROWSER_NET_PREDICTOR_H_ |
| 20 #define CHROME_BROWSER_NET_PREDICTOR_H_ | 20 #define CHROME_BROWSER_NET_PREDICTOR_H_ |
| 21 #pragma once | 21 #pragma once |
| 22 | 22 |
| 23 #include <map> | 23 #include <map> |
| 24 #include <queue> | 24 #include <queue> |
| 25 #include <set> | 25 #include <set> |
| 26 #include <string> | 26 #include <string> |
| 27 #include <vector> | |
| 28 | 27 |
| 29 #include "base/gtest_prod_util.h" | 28 #include "base/gtest_prod_util.h" |
| 30 #include "base/ref_counted.h" | 29 #include "base/ref_counted.h" |
| 31 #include "chrome/browser/net/url_info.h" | 30 #include "chrome/browser/net/url_info.h" |
| 32 #include "chrome/browser/net/referrer.h" | 31 #include "chrome/browser/net/referrer.h" |
| 33 #include "chrome/common/net/predictor_common.h" | 32 #include "chrome/common/net/predictor_common.h" |
| 34 #include "net/base/host_port_pair.h" | 33 #include "net/base/host_port_pair.h" |
| 35 | 34 |
| 36 class ListValue; | 35 class ListValue; |
| 37 | 36 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 // Are we currently using preconnection, rather than just DNS resolution, for | 261 // Are we currently using preconnection, rather than just DNS resolution, for |
| 263 // subresources and omni-box search URLs. | 262 // subresources and omni-box search URLs. |
| 264 bool preconnect_enabled_; | 263 bool preconnect_enabled_; |
| 265 | 264 |
| 266 DISALLOW_COPY_AND_ASSIGN(Predictor); | 265 DISALLOW_COPY_AND_ASSIGN(Predictor); |
| 267 }; | 266 }; |
| 268 | 267 |
| 269 } // namespace chrome_browser_net | 268 } // namespace chrome_browser_net |
| 270 | 269 |
| 271 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ | 270 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ |
| OLD | NEW |