Index: chrome/browser/prerender/prerender_contents.h |
=================================================================== |
--- chrome/browser/prerender/prerender_contents.h (revision 71174) |
+++ chrome/browser/prerender/prerender_contents.h (working copy) |
@@ -52,6 +52,10 @@ |
string16 title() const { return title_; } |
int32 page_id() const { return page_id_; } |
+ // Indicates whether this prerendered page can be used for the provided |
+ // URL, i.e. whether there is a match. |
+ bool MatchesUrl(const GURL& url); |
+ |
// RenderViewHostDelegate implementation. |
virtual RenderViewHostDelegate::View* GetViewDelegate(); |
virtual const GURL& GetURL() const; |
@@ -133,7 +137,21 @@ |
const std::string& value); |
virtual void ClearInspectorSettings(); |
+ protected: |
+ // from renderViewHostDelegate. |
+ virtual bool OnMessageReceived(const IPC::Message& message); |
+ |
private: |
+ // Message handlers. |
+ void OnDidStartProvisionalLoadForFrame(int64 frame_id, |
+ bool main_frame, |
+ const GURL& url); |
+ void OnDidRedirectProvisionalLoad(int32 page_id, |
+ const GURL& source_url, |
+ const GURL& target_url); |
+ |
+ void AddMatchingUrl(const GURL& url); |
+ |
// The prerender manager owning this object. |
PrerenderManager* prerender_manager_; |
@@ -162,6 +180,11 @@ |
GURL url_; |
NotificationRegistrar registrar_; |
+ // A vector of URLs that this prerendered page matches against. |
+ // This array can contain more than element as a result of redirects, |
+ // such as HTTP redirects or javascript redirects. |
+ std::vector<GURL> matching_urls_; |
+ |
DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
}; |