Index: chrome/browser/prerender/prerender_manager.h |
=================================================================== |
--- chrome/browser/prerender/prerender_manager.h (revision 72537) |
+++ chrome/browser/prerender/prerender_manager.h (working copy) |
@@ -11,18 +11,16 @@ |
#include "base/ref_counted.h" |
#include "base/scoped_ptr.h" |
-#include "base/threading/non_thread_safe.h" |
#include "base/time.h" |
+#include "chrome/browser/prerender/prerender_contents.h" |
#include "googleurl/src/gurl.h" |
-class PrerenderContents; |
class Profile; |
class TabContents; |
// PrerenderManager is responsible for initiating and keeping prerendered |
// views of webpages. |
-class PrerenderManager : public base::RefCounted<PrerenderManager>, |
- private base::NonThreadSafe { |
+class PrerenderManager : public base::RefCounted<PrerenderManager> { |
public: |
// Owned by a Profile object for the lifetime of the profile. |
explicit PrerenderManager(Profile* profile); |
@@ -55,7 +53,13 @@ |
protected: |
virtual ~PrerenderManager(); |
+ void SetPrerenderContentsFactory( |
+ PrerenderContents::Factory* prerender_contents_factory); |
+ |
private: |
+ // Test that needs needs access to internal functions. |
+ friend class PrerenderBrowserTest; |
+ |
friend class base::RefCounted<PrerenderManager>; |
struct PrerenderContentsData; |
@@ -66,6 +70,11 @@ |
const GURL& url, |
const std::vector<GURL>& alias_urls); |
+ // Finds the specified PrerenderContents and returns it, if it exists. |
+ // Returns NULL otherwise. Unlike GetEntry, the PrerenderManager maintains |
+ // ownership of the PrerenderContents. |
+ PrerenderContents* FindEntry(const GURL& url); |
+ |
Profile* profile_; |
base::TimeDelta max_prerender_age_; |
@@ -80,6 +89,8 @@ |
// Default maximum age a prerendered element may have, in seconds. |
static const int kDefaultMaxPrerenderAgeSeconds = 20; |
+ scoped_ptr<PrerenderContents::Factory> prerender_contents_factory_; |
+ |
DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
}; |