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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 236 void SaveStateForNextStartupAndTrim(); | 236 void SaveStateForNextStartupAndTrim(); |
| 237 | 237 |
| 238 void SaveDnsPrefetchStateForNextStartupAndTrim( | 238 void SaveDnsPrefetchStateForNextStartupAndTrim( |
| 239 base::ListValue* startup_list, | 239 base::ListValue* startup_list, |
| 240 base::ListValue* referral_list, | 240 base::ListValue* referral_list, |
| 241 base::WaitableEvent* completion); | 241 base::WaitableEvent* completion); |
| 242 | 242 |
| 243 // May be called from either the IO or UI thread and will PostTask | 243 // May be called from either the IO or UI thread and will PostTask |
| 244 // to the IO thread if necessary. | 244 // to the IO thread if necessary. |
| 245 void PreconnectUrl(const GURL& url, const GURL& first_party_for_cookies, | 245 void PreconnectUrl(const GURL& url, const GURL& first_party_for_cookies, |
| 246 UrlInfo::ResolutionMotivation motivation, int count); | 246 UrlInfo::ResolutionMotivation motivation, int count, |
| 247 bool isAnonymous = false); | |
|
Ryan Sleevi
2015/05/12 15:43:20
Ditto STYLE concerns here in this file
| |
| 247 | 248 |
| 248 void PreconnectUrlOnIOThread(const GURL& url, | 249 void PreconnectUrlOnIOThread(const GURL& url, |
| 249 const GURL& first_party_for_cookies, | 250 const GURL& first_party_for_cookies, |
| 250 UrlInfo::ResolutionMotivation motivation, | 251 UrlInfo::ResolutionMotivation motivation, |
| 251 int count); | 252 int count, |
| 253 bool isAnonymous = false); | |
| 252 | 254 |
| 253 // ------------- End IO thread methods. | 255 // ------------- End IO thread methods. |
| 254 | 256 |
| 255 // The following methods may be called on either the IO or UI threads. | 257 // The following methods may be called on either the IO or UI threads. |
| 256 | 258 |
| 257 // Instigate pre-connection to any URLs, or pre-resolution of related host, | 259 // Instigate pre-connection to any URLs, or pre-resolution of related host, |
| 258 // that we predict will be needed after this navigation (typically | 260 // that we predict will be needed after this navigation (typically |
| 259 // more-embedded resources on a page). This method will actually post a task | 261 // more-embedded resources on a page). This method will actually post a task |
| 260 // to do the actual work, so as not to jump ahead of the frame navigation that | 262 // to do the actual work, so as not to jump ahead of the frame navigation that |
| 261 // instigated this activity. | 263 // instigated this activity. |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 609 | 611 |
| 610 private: | 612 private: |
| 611 // These member functions return True for unittests. | 613 // These member functions return True for unittests. |
| 612 bool CanPrefetchAndPrerender() const override; | 614 bool CanPrefetchAndPrerender() const override; |
| 613 bool CanPreresolveAndPreconnect() const override; | 615 bool CanPreresolveAndPreconnect() const override; |
| 614 }; | 616 }; |
| 615 | 617 |
| 616 } // namespace chrome_browser_net | 618 } // namespace chrome_browser_net |
| 617 | 619 |
| 618 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ | 620 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ |
| OLD | NEW |