Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1753)

Unified Diff: chrome/browser/prerender/prerender_contents.h

Issue 6171007: For prerendering, keep track of all the intermediate redirects, and hook into... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_contents.h
===================================================================
--- chrome/browser/prerender/prerender_contents.h (revision 71703)
+++ chrome/browser/prerender/prerender_contents.h (working copy)
@@ -37,7 +37,7 @@
public JavaScriptAppModalDialogDelegate {
public:
PrerenderContents(PrerenderManager* prerender_manager, Profile* profile,
- const GURL& url);
+ const GURL& url, const std::vector<GURL>& alias_urls);
virtual ~PrerenderContents();
virtual void StartPrerendering();
@@ -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) const;
+
// 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 AddAliasURL(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> alias_urls_;
+
DISALLOW_COPY_AND_ASSIGN(PrerenderContents);
};
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698