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 #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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 379 | 379 |
| 380 // To be called once the cookie store for this profile has been loaded. | 380 // To be called once the cookie store for this profile has been loaded. |
| 381 void OnCookieStoreLoaded(); | 381 void OnCookieStoreLoaded(); |
| 382 | 382 |
| 383 // For testing purposes. Issues a callback once the cookie store has been | 383 // For testing purposes. Issues a callback once the cookie store has been |
| 384 // loaded. | 384 // loaded. |
| 385 void set_on_cookie_store_loaded_cb_for_testing(base::Closure cb) { | 385 void set_on_cookie_store_loaded_cb_for_testing(base::Closure cb) { |
| 386 on_cookie_store_loaded_cb_for_testing_ = cb; | 386 on_cookie_store_loaded_cb_for_testing_ = cb; |
| 387 } | 387 } |
| 388 | 388 |
| 389 // Returns whether prerendering is currently enabled for this manager. | |
| 390 // Must be called on the UI thread. | |
|
Peter Kasting
2014/06/19 21:20:33
Nit: No need to add the last sentence since the cl
kmadhusu
2014/06/19 22:52:49
Done.
| |
| 391 bool IsEnabled() const; | |
| 392 | |
| 389 protected: | 393 protected: |
| 390 class PendingSwap; | 394 class PendingSwap; |
| 391 class PrerenderData : public base::SupportsWeakPtr<PrerenderData> { | 395 class PrerenderData : public base::SupportsWeakPtr<PrerenderData> { |
| 392 public: | 396 public: |
| 393 struct OrderByExpiryTime; | 397 struct OrderByExpiryTime; |
| 394 | 398 |
| 395 PrerenderData(PrerenderManager* manager, | 399 PrerenderData(PrerenderManager* manager, |
| 396 PrerenderContents* contents, | 400 PrerenderContents* contents, |
| 397 base::TimeTicks expiry_time); | 401 base::TimeTicks expiry_time); |
| 398 | 402 |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 653 FinalStatus final_status); | 657 FinalStatus final_status); |
| 654 | 658 |
| 655 // Records the final status a prerender in the case that a PrerenderContents | 659 // Records the final status a prerender in the case that a PrerenderContents |
| 656 // was never created, and also adds a PrerenderHistory entry. | 660 // was never created, and also adds a PrerenderHistory entry. |
| 657 // This is a helper function which will ultimately call | 661 // This is a helper function which will ultimately call |
| 658 // RecordFinalStatusWthMatchCompleteStatus, using MATCH_COMPLETE_DEFAULT. | 662 // RecordFinalStatusWthMatchCompleteStatus, using MATCH_COMPLETE_DEFAULT. |
| 659 void RecordFinalStatusWithoutCreatingPrerenderContents( | 663 void RecordFinalStatusWithoutCreatingPrerenderContents( |
| 660 const GURL& url, Origin origin, uint8 experiment_id, | 664 const GURL& url, Origin origin, uint8 experiment_id, |
| 661 FinalStatus final_status) const; | 665 FinalStatus final_status) const; |
| 662 | 666 |
| 663 // Returns whether prerendering is currently enabled for this manager. | |
| 664 // Must be called on the UI thread. | |
| 665 bool IsEnabled() const; | |
| 666 | 667 |
| 667 void CookieChanged(ChromeCookieDetails* details); | 668 void CookieChanged(ChromeCookieDetails* details); |
| 668 void CookieChangedAnyCookiesLeftLookupResult(const std::string& domain_key, | 669 void CookieChangedAnyCookiesLeftLookupResult(const std::string& domain_key, |
| 669 bool cookies_exist); | 670 bool cookies_exist); |
| 670 void LoggedInPredictorDataReceived(scoped_ptr<LoggedInStateMap> new_map); | 671 void LoggedInPredictorDataReceived(scoped_ptr<LoggedInStateMap> new_map); |
| 671 | 672 |
| 672 void RecordEvent(PrerenderContents* contents, PrerenderEvent event) const; | 673 void RecordEvent(PrerenderContents* contents, PrerenderEvent event) const; |
| 673 | 674 |
| 674 // Swaps a prerender |prerender_data| for |url| into the tab, replacing | 675 // Swaps a prerender |prerender_data| for |url| into the tab, replacing |
| 675 // |web_contents|. Returns the new WebContents that was swapped in, or NULL | 676 // |web_contents|. Returns the new WebContents that was swapped in, or NULL |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 759 bool cookie_store_loaded_; | 760 bool cookie_store_loaded_; |
| 760 | 761 |
| 761 base::Closure on_cookie_store_loaded_cb_for_testing_; | 762 base::Closure on_cookie_store_loaded_cb_for_testing_; |
| 762 | 763 |
| 763 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 764 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
| 764 }; | 765 }; |
| 765 | 766 |
| 766 } // namespace prerender | 767 } // namespace prerender |
| 767 | 768 |
| 768 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 769 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
| OLD | NEW |