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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 | 510 |
511 // Reference to URLRequestContextGetter from the Profile which owns the | 511 // Reference to URLRequestContextGetter from the Profile which owns the |
512 // predictor. Used by Preconnect. | 512 // predictor. Used by Preconnect. |
513 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; | 513 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; |
514 | 514 |
515 // Status of speculative DNS resolution and speculative TCP/IP connection | 515 // Status of speculative DNS resolution and speculative TCP/IP connection |
516 // feature. This is false if and only if disabled by a command line switch. | 516 // feature. This is false if and only if disabled by a command line switch. |
517 const bool predictor_enabled_; | 517 const bool predictor_enabled_; |
518 | 518 |
519 // This is set by InitNetworkPredictor and used for calling | 519 // This is set by InitNetworkPredictor and used for calling |
520 // chrome_browser_net::CanPredictNetworkActionsUI. | 520 // CanPrefetchAndPrerenderUI and CanPreresolveAndPreconnectUI. |
521 PrefService* user_prefs_; | 521 PrefService* user_prefs_; |
522 | 522 |
523 // This is set by InitNetworkPredictor and used for calling | 523 // This is set by InitNetworkPredictor and used for calling |
524 // chrome_browser_net::CanPredictNetworkActionsIO. | 524 // CanPrefetchAndPrerenderIO and CanPreresolveAndPreconnectIO. |
525 ProfileIOData* profile_io_data_; | 525 ProfileIOData* profile_io_data_; |
526 | 526 |
527 // work_queue_ holds a list of names we need to look up. | 527 // work_queue_ holds a list of names we need to look up. |
528 HostNameQueue work_queue_; | 528 HostNameQueue work_queue_; |
529 | 529 |
530 // results_ contains information for existing/prior prefetches. | 530 // results_ contains information for existing/prior prefetches. |
531 Results results_; | 531 Results results_; |
532 | 532 |
533 std::set<LookupRequest*> pending_lookups_; | 533 std::set<LookupRequest*> pending_lookups_; |
534 | 534 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 virtual void ShutdownOnUIThread() OVERRIDE; | 614 virtual void ShutdownOnUIThread() OVERRIDE; |
615 private: | 615 private: |
616 // These member functions return True for unittests. | 616 // These member functions return True for unittests. |
617 virtual bool CanPrefetchAndPrerender() const OVERRIDE; | 617 virtual bool CanPrefetchAndPrerender() const OVERRIDE; |
618 virtual bool CanPreresolveAndPreconnect() const OVERRIDE; | 618 virtual bool CanPreresolveAndPreconnect() const OVERRIDE; |
619 }; | 619 }; |
620 | 620 |
621 } // namespace chrome_browser_net | 621 } // namespace chrome_browser_net |
622 | 622 |
623 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ | 623 #endif // CHROME_BROWSER_NET_PREDICTOR_H_ |
OLD | NEW |