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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // be performed. Host lookups will be issued through |host_resolver|. | 103 // be performed. Host lookups will be issued through |host_resolver|. |
104 explicit Predictor(bool preconnect_enabled); | 104 explicit Predictor(bool preconnect_enabled); |
105 | 105 |
106 virtual ~Predictor(); | 106 virtual ~Predictor(); |
107 | 107 |
108 // This function is used to create a predictor. For testing, we can create | 108 // This function is used to create a predictor. For testing, we can create |
109 // a version which does a simpler shutdown. | 109 // a version which does a simpler shutdown. |
110 static Predictor* CreatePredictor(bool preconnect_enabled, | 110 static Predictor* CreatePredictor(bool preconnect_enabled, |
111 bool simple_shutdown); | 111 bool simple_shutdown); |
112 | 112 |
113 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); | 113 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
114 | 114 |
115 // ------------- Start UI thread methods. | 115 // ------------- Start UI thread methods. |
116 | 116 |
117 virtual void InitNetworkPredictor(PrefService* user_prefs, | 117 virtual void InitNetworkPredictor(PrefService* user_prefs, |
118 PrefService* local_state, | 118 PrefService* local_state, |
119 IOThread* io_thread, | 119 IOThread* io_thread, |
120 net::URLRequestContextGetter* getter); | 120 net::URLRequestContextGetter* getter); |
121 | 121 |
122 // The Omnibox has proposed a given url to the user, and if it is a search | 122 // The Omnibox has proposed a given url to the user, and if it is a search |
123 // URL, then it also indicates that this is preconnectable (i.e., we could | 123 // URL, then it also indicates that this is preconnectable (i.e., we could |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 PrefService* user_prefs, | 539 PrefService* user_prefs, |
540 PrefService* local_state, | 540 PrefService* local_state, |
541 IOThread* io_thread, | 541 IOThread* io_thread, |
542 net::URLRequestContextGetter* getter) OVERRIDE; | 542 net::URLRequestContextGetter* getter) OVERRIDE; |
543 virtual void ShutdownOnUIThread(PrefService* user_prefs) OVERRIDE; | 543 virtual void ShutdownOnUIThread(PrefService* user_prefs) OVERRIDE; |
544 }; | 544 }; |
545 | 545 |
546 } // namespace chrome_browser_net | 546 } // namespace chrome_browser_net |
547 | 547 |
548 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ | 548 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ |
OLD | NEW |