| 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 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
| 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 namespace gfx { | 58 namespace gfx { |
| 59 class Size; | 59 class Size; |
| 60 } | 60 } |
| 61 | 61 |
| 62 namespace net { | 62 namespace net { |
| 63 class URLRequestContextGetter; | 63 class URLRequestContextGetter; |
| 64 } | 64 } |
| 65 | 65 |
| 66 namespace prerender { | 66 namespace prerender { |
| 67 | 67 |
| 68 class PrerenderCondition; | |
| 69 class PrerenderHandle; | 68 class PrerenderHandle; |
| 70 class PrerenderHistory; | 69 class PrerenderHistory; |
| 71 class PrerenderLocalPredictor; | 70 class PrerenderLocalPredictor; |
| 72 | 71 |
| 73 // PrerenderManager is responsible for initiating and keeping prerendered | 72 // PrerenderManager is responsible for initiating and keeping prerendered |
| 74 // views of web pages. All methods must be called on the UI thread unless | 73 // views of web pages. All methods must be called on the UI thread unless |
| 75 // indicated otherwise. | 74 // indicated otherwise. |
| 76 class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>, | 75 class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>, |
| 77 public base::NonThreadSafe, | 76 public base::NonThreadSafe, |
| 78 public content::NotificationObserver, | 77 public content::NotificationObserver, |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 virtual void OnCreatingAudioStream(int render_process_id, | 292 virtual void OnCreatingAudioStream(int render_process_id, |
| 294 int render_frame_id) OVERRIDE; | 293 int render_frame_id) OVERRIDE; |
| 295 | 294 |
| 296 const Config& config() const { return config_; } | 295 const Config& config() const { return config_; } |
| 297 Config& mutable_config() { return config_; } | 296 Config& mutable_config() { return config_; } |
| 298 | 297 |
| 299 PrerenderTracker* prerender_tracker() { return prerender_tracker_; } | 298 PrerenderTracker* prerender_tracker() { return prerender_tracker_; } |
| 300 | 299 |
| 301 bool cookie_store_loaded() { return cookie_store_loaded_; } | 300 bool cookie_store_loaded() { return cookie_store_loaded_; } |
| 302 | 301 |
| 303 // Adds a condition. This is owned by the PrerenderManager. | |
| 304 void AddCondition(const PrerenderCondition* condition); | |
| 305 | |
| 306 // Records that some visible tab navigated (or was redirected) to the | 302 // Records that some visible tab navigated (or was redirected) to the |
| 307 // provided URL. | 303 // provided URL. |
| 308 void RecordNavigation(const GURL& url); | 304 void RecordNavigation(const GURL& url); |
| 309 | 305 |
| 310 // Updates the LoggedInPredictor state to reflect that a login has likely | 306 // Updates the LoggedInPredictor state to reflect that a login has likely |
| 311 // on the URL provided. | 307 // on the URL provided. |
| 312 void RecordLikelyLoginOnURL(const GURL& url); | 308 void RecordLikelyLoginOnURL(const GURL& url); |
| 313 | 309 |
| 314 // Checks if the LoggedInPredictor shows that the user is likely logged on | 310 // Checks if the LoggedInPredictor shows that the user is likely logged on |
| 315 // to the site for the URL provided. | 311 // to the site for the URL provided. |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 | 707 |
| 712 // Track time of last prerender to limit prerender spam. | 708 // Track time of last prerender to limit prerender spam. |
| 713 base::TimeTicks last_prerender_start_time_; | 709 base::TimeTicks last_prerender_start_time_; |
| 714 | 710 |
| 715 std::list<content::WebContents*> old_web_contents_list_; | 711 std::list<content::WebContents*> old_web_contents_list_; |
| 716 | 712 |
| 717 ScopedVector<OnCloseWebContentsDeleter> on_close_web_contents_deleters_; | 713 ScopedVector<OnCloseWebContentsDeleter> on_close_web_contents_deleters_; |
| 718 | 714 |
| 719 scoped_ptr<PrerenderHistory> prerender_history_; | 715 scoped_ptr<PrerenderHistory> prerender_history_; |
| 720 | 716 |
| 721 std::list<const PrerenderCondition*> prerender_conditions_; | |
| 722 | |
| 723 scoped_ptr<PrerenderHistograms> histograms_; | 717 scoped_ptr<PrerenderHistograms> histograms_; |
| 724 | 718 |
| 725 scoped_ptr<PrerenderLocalPredictor> local_predictor_; | 719 scoped_ptr<PrerenderLocalPredictor> local_predictor_; |
| 726 | 720 |
| 727 scoped_refptr<predictors::LoggedInPredictorTable> logged_in_predictor_table_; | 721 scoped_refptr<predictors::LoggedInPredictorTable> logged_in_predictor_table_; |
| 728 | 722 |
| 729 // Here, we keep the logged in predictor state, but potentially a superset | 723 // Here, we keep the logged in predictor state, but potentially a superset |
| 730 // of its actual (database-backed) state, since we do not incorporate | 724 // of its actual (database-backed) state, since we do not incorporate |
| 731 // browser data deletion. We do not use this for actual lookups, but only | 725 // browser data deletion. We do not use this for actual lookups, but only |
| 732 // to query cookie data for domains we know there was a login before. | 726 // to query cookie data for domains we know there was a login before. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 753 bool cookie_store_loaded_; | 747 bool cookie_store_loaded_; |
| 754 | 748 |
| 755 base::Closure on_cookie_store_loaded_cb_for_testing_; | 749 base::Closure on_cookie_store_loaded_cb_for_testing_; |
| 756 | 750 |
| 757 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 751 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
| 758 }; | 752 }; |
| 759 | 753 |
| 760 } // namespace prerender | 754 } // namespace prerender |
| 761 | 755 |
| 762 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 756 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
| OLD | NEW |