Index: chrome/browser/prerender/prerender_manager.h |
=================================================================== |
--- chrome/browser/prerender/prerender_manager.h (revision 265252) |
+++ chrome/browser/prerender/prerender_manager.h (working copy) |
@@ -295,6 +295,8 @@ |
PrerenderTracker* prerender_tracker() { return prerender_tracker_; } |
+ bool cookie_store_loaded() { return cookie_store_loaded_; } |
+ |
// Adds a condition. This is owned by the PrerenderManager. |
void AddCondition(const PrerenderCondition* condition); |
@@ -360,6 +362,15 @@ |
// profile if prerendering is currently enabled. |
void AddProfileNetworkBytesIfEnabled(int64 bytes); |
+ // To be called once the cookie store for this profile has been loaded. |
+ void OnCookieStoreLoaded(); |
+ |
+ // For testing purposes. Issues a callback once the cookie store has been |
+ // loaded. |
+ void set_on_cookie_store_loaded_cb(base::Closure cb) { |
Charlie Reis
2014/05/07 17:21:32
I think we typically include "_for_testing" in the
tburkard
2014/05/07 18:34:27
Done.
|
+ on_cookie_store_loaded_cb_ = cb; |
+ } |
+ |
protected: |
class PendingSwap; |
class PrerenderData : public base::SupportsWeakPtr<PrerenderData> { |
@@ -511,6 +522,11 @@ |
// shorten the TTL of the prerendered page. |
void SourceNavigatedAway(PrerenderData* prerender_data); |
+ // Gets the request context for the profile. |
+ // For unit tests, this will be overriden to return NULL, since it is not |
+ // needed. |
+ virtual net::URLRequestContextGetter* GetURLRequestContext(); |
+ |
private: |
friend class ::InstantSearchPrerendererTest; |
friend class PrerenderBrowserTest; |
@@ -720,6 +736,11 @@ |
// The value of profile_network_bytes_ that was last recorded. |
int64 last_recorded_profile_network_bytes_; |
+ // Indicates whether the cookie store for this profile has fully loaded yet. |
+ bool cookie_store_loaded_; |
+ |
+ base::Closure on_cookie_store_loaded_cb_; |
+ |
DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
}; |