Chromium Code Reviews| Index: chrome/browser/prerender/prerender_contents.h |
| diff --git a/chrome/browser/prerender/prerender_contents.h b/chrome/browser/prerender/prerender_contents.h |
| index feeb4f43963a6aa7540be0fadf9c17b8e5686e73..d08df6db14f2289b1fcf130e437dbbd36f3cf91a 100644 |
| --- a/chrome/browser/prerender/prerender_contents.h |
| +++ b/chrome/browser/prerender/prerender_contents.h |
| @@ -8,6 +8,7 @@ |
| #include <list> |
| #include <string> |
| +#include <utility> |
| #include <vector> |
| #include "base/memory/scoped_ptr.h" |
| @@ -18,6 +19,7 @@ |
| #include "content/public/browser/notification_registrar.h" |
| #include "content/public/browser/web_contents_observer.h" |
| #include "content/public/common/referrer.h" |
| +#include "ui/gfx/size.h" |
| class Profile; |
| class TabContentsWrapper; |
| @@ -66,15 +68,7 @@ class PrerenderContents : public content::NotificationObserver, |
| }; |
| // Information on pages that the prerendered page has tried to prerender. |
| - struct PendingPrerenderData { |
| - PendingPrerenderData(Origin origin, |
| - const GURL& url, |
| - const content::Referrer& referrer); |
| - |
| - Origin origin; |
| - GURL url; |
| - content::Referrer referrer; |
| - }; |
| + typedef std::pair<GURL, content::Referrer> PendingPrerenderData; |
|
mmenke
2012/04/30 18:35:22
nit: Now that we have a "PrerenderExtraData", I s
gavinp
2012/04/30 23:55:39
Done, but spelled right.
mmenke
2012/05/01 16:23:21
I'm not going to sign off on this until you duplic
|
| typedef std::list<PendingPrerenderData> PendingPrerenderList; |
| // Indicates how this PrerenderContents relates to MatchComplete. |
| @@ -103,15 +97,17 @@ class PrerenderContents : public content::NotificationObserver, |
| // |source_render_view_host| is the RenderViewHost that initiated |
| // prerendering. |
| virtual void StartPrerendering( |
| - const content::RenderViewHost* source_render_view_host, |
| + int creator_child_id, |
| + const gfx::Size& size, |
| content::SessionStorageNamespace* session_storage_namespace); |
| // Verifies that the prerendering is not using too many resources, and kills |
| // it if not. |
| void DestroyWhenUsingTooManyResources(); |
| - content::RenderViewHost* render_view_host_mutable(); |
| - const content::RenderViewHost* render_view_host() const; |
| + content::RenderViewHost* GetRenderViewHostMutable(); |
| + const content::RenderViewHost* GetRenderViewHost() const; |
| + |
| string16 title() const { return title_; } |
| int32 page_id() const { return page_id_; } |
| GURL icon_url() const { return icon_url_; } |
| @@ -149,6 +145,8 @@ class PrerenderContents : public content::NotificationObserver, |
| // Indicates whether this prerendered page can be used for the provided |
| // URL, i.e. whether there is a match. |matching_url| is optional and will be |
| // set to the URL that is found as a match if it is provided. |
| + // TODO(gavinp,mmenke): Rework matching to be based on both the URL |
| + // and the session WebStorage. |
| bool MatchesURL(const GURL& url, GURL* matching_url) const; |
| void OnJSOutOfMemory(); |
| @@ -205,8 +203,7 @@ class PrerenderContents : public content::NotificationObserver, |
| bool IsCrossSiteNavigationPending() const; |
| // Adds a pending prerender to the list. |
| - virtual void AddPendingPrerender(Origin origin, |
| - const GURL& url, |
| + virtual void AddPendingPrerender(const GURL& url, |
| const content::Referrer& referrer); |
| // Returns true if |url| corresponds to a pending prerender. |
| @@ -238,6 +235,10 @@ class PrerenderContents : public content::NotificationObserver, |
| return &pending_prerender_list_; |
| } |
| + bool prerendering_has_been_cancelled() const { |
| + return prerendering_has_been_cancelled_; |
| + } |
| + |
| virtual content::WebContents* CreateWebContents( |
| content::SessionStorageNamespace* session_storage_namespace); |
| @@ -341,6 +342,9 @@ class PrerenderContents : public content::NotificationObserver, |
| // The process that created the child id. |
| int creator_child_id_; |
| + // The size of the WebView from the launching page. |
| + gfx::Size size_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
| }; |