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

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

Issue 8392041: Prerendered tabs use the same SessionStorage namespace as the tab that triggered the prerender. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Indent fixes Created 9 years, 2 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
Index: chrome/browser/prerender/prerender_manager.h
diff --git a/chrome/browser/prerender/prerender_manager.h b/chrome/browser/prerender/prerender_manager.h
index abd1541dc3366309fcb2b930c7239cea6e598fec..8c086a1ec60cc1c0445a78ebd15201aa98ed3882 100644
--- a/chrome/browser/prerender/prerender_manager.h
+++ b/chrome/browser/prerender/prerender_manager.h
@@ -101,8 +101,12 @@ class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>,
// Adds a prerender for |url| if valid. As the prerender request is coming
// from a source without a RenderViewHost (i.e., the omnibox) we don't have a
// child or route id, or a referrer. This method uses sensible values for
- // those.
- bool AddPrerenderFromOmnibox(const GURL& url);
+ // those. The |session_storage_namespace| can be determined at this time,
+ // however, because it is based off of the destination tab rather than the
+ // current contents.
+ bool AddPrerenderFromOmnibox(
+ const GURL& url,
+ SessionStorageNamespace* session_storage_namespace);
// Destroy all prerenders for the given child route id pair and assign a final
// status to them.
@@ -245,12 +249,15 @@ class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>,
// Adds a prerender for |url| from referrer |referrer| initiated from the
// RenderViewHost specified by |child_route_id_pair|. The |origin| specifies
- // how the prerender was added.
+ // how the prerender was added. If the |session_storage_namespace| is NULL,
+ // it is discovered using the RenderViewHost specified by
+ // |child_route_id_pair|.
bool AddPrerender(
Origin origin,
const std::pair<int, int>& child_route_id_pair,
const GURL& url,
- const GURL& referrer);
+ const GURL& referrer,
+ SessionStorageNamespace* session_storage_namespace);
// Adds a pending preload issued by the prerendering RenderView identified by
// |child_route_id_pair|. If and when that prerendering RenderView is used,
@@ -293,10 +300,12 @@ class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>,
void DeleteOldEntries();
virtual base::Time GetCurrentTime() const;
virtual base::TimeTicks GetCurrentTimeTicks() const;
- virtual PrerenderContents* CreatePrerenderContents(const GURL& url,
- const GURL& referrer,
- Origin origin,
- uint8 experiment_id);
+ virtual PrerenderContents* CreatePrerenderContents(
+ SessionStorageNamespace* session_storage_namespace,
+ const GURL& url,
+ const GURL& referrer,
+ Origin origin,
+ uint8 experiment_id);
// Checks if the PrerenderContents has been added to the pending delete list.
bool IsPendingDelete(PrerenderContents* entry) const;

Powered by Google App Engine
This is Rietveld 408576698