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

Unified Diff: content/browser/web_contents/navigation_controller_impl.h

Issue 10831116: Move SessionStorageNamespace entirely into NavigationController and support StoragePartitions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 8 years, 4 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: content/browser/web_contents/navigation_controller_impl.h
diff --git a/content/browser/web_contents/navigation_controller_impl.h b/content/browser/web_contents/navigation_controller_impl.h
index ac3106cf8471f218591c7590fb78dca93f22d146..240864554859526064b27228b61d5c92fbff72a2 100644
--- a/content/browser/web_contents/navigation_controller_impl.h
+++ b/content/browser/web_contents/navigation_controller_impl.h
@@ -14,7 +14,6 @@
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_type.h"
-class SessionStorageNamespaceImpl;
struct ViewHostMsg_FrameNavigate_Params;
class WebContentsImpl;
@@ -30,8 +29,7 @@ class CONTENT_EXPORT NavigationControllerImpl
public:
NavigationControllerImpl(
WebContentsImpl* web_contents,
- content::BrowserContext* browser_context,
- SessionStorageNamespaceImpl* session_storage_namespace);
+ content::BrowserContext* browser_context);
virtual ~NavigationControllerImpl();
// NavigationController implementation:
@@ -87,8 +85,10 @@ class CONTENT_EXPORT NavigationControllerImpl
virtual void GoToIndex(int index) OVERRIDE;
virtual void GoToOffset(int offset) OVERRIDE;
virtual void RemoveEntryAtIndex(int index) OVERRIDE;
+ virtual const content::SessionStorageNamespaceMap&
+ GetSessionStorageNamespaceMap() const OVERRIDE;
virtual content::SessionStorageNamespace*
- GetSessionStorageNamespace() const OVERRIDE;
+ GetDefaultSessionStorageNamespace() OVERRIDE;
virtual void SetMaxRestoredPageID(int32 max_id) OVERRIDE;
virtual int32 GetMaxRestoredPageID() const OVERRIDE;
virtual bool NeedsReload() const OVERRIDE;
@@ -117,6 +117,11 @@ class CONTENT_EXPORT NavigationControllerImpl
const base::RefCountedMemory& http_body,
bool is_overriding_user_agent) OVERRIDE;
+ // The session storage namespace that all child RenderViews in the renderer
+ // process with the given ID should use.
Charlie Reis 2012/08/13 19:39:22 This comment is stale, since we now use the SiteIn
awong 2012/08/13 21:29:19 Done.
+ content::SessionStorageNamespace* GetSessionStorageNamespace(
+ content::SiteInstance* instance);
+
// Returns the index of the specified entry, or -1 if entry is not contained
// in this NavigationController.
int GetIndexOfEntry(const content::NavigationEntryImpl* entry) const;
@@ -190,6 +195,18 @@ class CONTENT_EXPORT NavigationControllerImpl
// refs without reload, only change to "#" which we don't count as empty).
bool IsURLInPageNavigation(const GURL& url) const;
+ // Sets the SessionStorageNamespace for the given |partition_id|. This is
+ // used during initialization of a new NavigationController to allow
+ // pre-population of the SessionStorageNamespace objects. Session restore,
+ // prerendering, and the implementaion of window.open() are the primary users
+ // of this API.
+ //
+ // Calling this function when a SessionStorageNamespace has already been
+ // associated with a |partition_id| will CHECK() fail.
+ void SetSessionStorageNamespace(
+ const std::string& partition_id,
+ content::SessionStorageNamespace* session_storage_namespace);
+
// Random data ---------------------------------------------------------------
SSLManager* ssl_manager() { return &ssl_manager_; }
@@ -344,8 +361,14 @@ class CONTENT_EXPORT NavigationControllerImpl
// The time ticks at which the last document was loaded.
base::TimeTicks last_document_loaded_;
- // The session storage id that any (indirectly) owned RenderView should use.
- scoped_refptr<SessionStorageNamespaceImpl> session_storage_namespace_;
+ // Used to find the appropriate SessionStorageNamespace for the storage
+ // partition of a NavigationEntry.
+ //
+ // A NavigationController may contain NavigationEntries that correspond to
+ // different StoragePartitions. Even though they are part of the same
+ // NavigationController, only entries in the same StoragePartition may
+ // share session storage state with one another.
+ content::SessionStorageNamespaceMap session_storage_namespace_map_;
// The maximum number of entries that a navigation controller can store.
static size_t max_entry_count_for_testing_;

Powered by Google App Engine
This is Rietveld 408576698