| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 // to the IO thread if necessary. | 235 // to the IO thread if necessary. |
| 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, |
| 246 UrlInfo::ResolutionMotivation motivation, int count); | 246 const GURL& first_party_for_cookies, |
| 247 UrlInfo::ResolutionMotivation motivation, |
| 248 int count, |
| 249 bool allow_credentials); |
| 247 | 250 |
| 248 void PreconnectUrlOnIOThread(const GURL& url, | 251 void PreconnectUrlOnIOThread(const GURL& url, |
| 249 const GURL& first_party_for_cookies, | 252 const GURL& first_party_for_cookies, |
| 250 UrlInfo::ResolutionMotivation motivation, | 253 UrlInfo::ResolutionMotivation motivation, |
| 251 int count); | 254 int count, |
| 255 bool allow_credentials); |
| 252 | 256 |
| 253 // ------------- End IO thread methods. | 257 // ------------- End IO thread methods. |
| 254 | 258 |
| 255 // The following methods may be called on either the IO or UI threads. | 259 // The following methods may be called on either the IO or UI threads. |
| 256 | 260 |
| 257 // Instigate pre-connection to any URLs, or pre-resolution of related host, | 261 // Instigate pre-connection to any URLs, or pre-resolution of related host, |
| 258 // that we predict will be needed after this navigation (typically | 262 // that we predict will be needed after this navigation (typically |
| 259 // more-embedded resources on a page). This method will actually post a task | 263 // 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 | 264 // to do the actual work, so as not to jump ahead of the frame navigation that |
| 261 // instigated this activity. | 265 // instigated this activity. |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 | 613 |
| 610 private: | 614 private: |
| 611 // These member functions return True for unittests. | 615 // These member functions return True for unittests. |
| 612 bool CanPrefetchAndPrerender() const override; | 616 bool CanPrefetchAndPrerender() const override; |
| 613 bool CanPreresolveAndPreconnect() const override; | 617 bool CanPreresolveAndPreconnect() const override; |
| 614 }; | 618 }; |
| 615 | 619 |
| 616 } // namespace chrome_browser_net | 620 } // namespace chrome_browser_net |
| 617 | 621 |
| 618 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ | 622 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ |
| OLD | NEW |