From 6ee12c40c7888500e87b33fb1993faf3d689eb09 Mon Sep 17 00:00:00 2001 From: "jorlow@chromium.org" Date: Tue, 14 Sep 2010 09:36:07 +0000 Subject: Fix SessionStorage Apparently the session storage code was pretty horribly broken. It didn't correctly handle tabs being restored, didn't have the proper lifetime (this was the issue exposed in the bug), and had many leaks. To fix this, things had to be plumbed fairly differently. We need to pass session storage in on TabContents creation to ensure that the first RenderView will have the correct session storage id. When closing a tab, we need to save the session storage with the restoration service. When restoring a tab, we pass it back into the tab contents class. When duplicating a tab, we clone the storage. Lifetimes are now handled by standard reference counting code. A SessionStorageNamespace object wraps an ID. When it's instantiated, it allocates an ID. When it's destroyed, it deletes the ID. IDs make this process very lightweight (the heavyweight stuff is allocated on first use of SessionStorage) and it seperates the more complex lifetimes of SessionStorage namespaces (where less deterministic shutdown is more tollerable) from the LocalStorage namespace which needs to shutdown very precisely. BUG=52393 TEST=Set some variable on session storage; close the tab; re-open the tab; the variable should still be set. You can also run through the repro steps in the bug. Review URL: http://codereview.chromium.org/3325012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59350 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/sidebar/sidebar_container.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chrome/browser/sidebar') diff --git a/chrome/browser/sidebar/sidebar_container.cc b/chrome/browser/sidebar/sidebar_container.cc index 73cac8d..aae917a 100644 --- a/chrome/browser/sidebar/sidebar_container.cc +++ b/chrome/browser/sidebar/sidebar_container.cc @@ -22,7 +22,7 @@ SidebarContainer::SidebarContainer(TabContents* tab, icon_(new SkBitmap) { // Create TabContents for sidebar. sidebar_contents_.reset( - new TabContents(tab->profile(), NULL, MSG_ROUTING_NONE, NULL)); + new TabContents(tab->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL)); sidebar_contents_->render_view_host()->set_is_extension_process(true); sidebar_contents_->render_view_host()->AllowBindings( BindingsPolicy::EXTENSION); -- cgit v1.1