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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 // but it is destroyed on the IO thread when ProfileIOData goes away. All of | 76 // but it is destroyed on the IO thread when ProfileIOData goes away. All of |
| 77 // its core state and functionality happens on the IO thread. The only UI | 77 // its core state and functionality happens on the IO thread. The only UI |
| 78 // methods are initialization / shutdown related (including preconnect | 78 // methods are initialization / shutdown related (including preconnect |
| 79 // initialization), or convenience methods that internally forward calls to | 79 // initialization), or convenience methods that internally forward calls to |
| 80 // the IO thread. | 80 // the IO thread. |
| 81 class Predictor { | 81 class Predictor { |
| 82 public: | 82 public: |
| 83 // Enum describing when to allow network predictions based on connection type. | 83 // Enum describing when to allow network predictions based on connection type. |
| 84 // The same enum must be used by the platform-dependent components. | 84 // The same enum must be used by the platform-dependent components. |
| 85 // TODO(bnc): implement as per crbug.com/334602. | 85 // TODO(bnc): implement as per crbug.com/334602. |
| 86 // NETWORK_PREDICTION_UNSET means that the old setting(s) should be observed. | |
|
jkarlin
2014/06/26 16:28:52
Unclear what "the old settings" refers to here.
Bence
2014/06/26 20:02:06
Done.
| |
| 86 enum NetworkPredictionOptions { | 87 enum NetworkPredictionOptions { |
| 87 NETWORK_PREDICTION_ALWAYS, | 88 NETWORK_PREDICTION_ALWAYS, |
| 88 NETWORK_PREDICTION_WIFI_ONLY, | 89 NETWORK_PREDICTION_WIFI_ONLY, |
| 89 NETWORK_PREDICTION_NEVER | 90 NETWORK_PREDICTION_NEVER, |
| 91 NETWORK_PREDICTION_UNSET, | |
| 90 }; | 92 }; |
| 91 | 93 |
| 92 // A version number for prefs that are saved. This should be incremented when | 94 // A version number for prefs that are saved. This should be incremented when |
| 93 // we change the format so that we discard old data. | 95 // we change the format so that we discard old data. |
| 94 static const int kPredictorReferrerVersion; | 96 static const int kPredictorReferrerVersion; |
| 95 | 97 |
| 96 // Given that the underlying Chromium resolver defaults to a total maximum of | 98 // Given that the underlying Chromium resolver defaults to a total maximum of |
| 97 // 8 paralell resolutions, we will avoid any chance of starving navigational | 99 // 8 paralell resolutions, we will avoid any chance of starving navigational |
| 98 // resolutions by limiting the number of paralell speculative resolutions. | 100 // resolutions by limiting the number of paralell speculative resolutions. |
| 99 // This is used in the field trials and testing. | 101 // This is used in the field trials and testing. |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 614 PrefService* user_prefs, | 616 PrefService* user_prefs, |
| 615 PrefService* local_state, | 617 PrefService* local_state, |
| 616 IOThread* io_thread, | 618 IOThread* io_thread, |
| 617 net::URLRequestContextGetter* getter) OVERRIDE; | 619 net::URLRequestContextGetter* getter) OVERRIDE; |
| 618 virtual void ShutdownOnUIThread() OVERRIDE; | 620 virtual void ShutdownOnUIThread() OVERRIDE; |
| 619 }; | 621 }; |
| 620 | 622 |
| 621 } // namespace chrome_browser_net | 623 } // namespace chrome_browser_net |
| 622 | 624 |
| 623 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ | 625 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ |
| OLD | NEW |