diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-14 09:36:07 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-14 09:36:07 +0000 |
commit | 6ee12c40c7888500e87b33fb1993faf3d689eb09 (patch) | |
tree | 5db10a6c2c6d5466f906952d3c87f5c4534bf685 /chrome/browser/tab_contents/test_tab_contents.cc | |
parent | c0f533f2784bb98483b29d68609a5118dd86c92a (diff) | |
download | chromium_src-6ee12c40c7888500e87b33fb1993faf3d689eb09.zip chromium_src-6ee12c40c7888500e87b33fb1993faf3d689eb09.tar.gz chromium_src-6ee12c40c7888500e87b33fb1993faf3d689eb09.tar.bz2 |
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
Diffstat (limited to 'chrome/browser/tab_contents/test_tab_contents.cc')
-rw-r--r-- | chrome/browser/tab_contents/test_tab_contents.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/chrome/browser/tab_contents/test_tab_contents.cc b/chrome/browser/tab_contents/test_tab_contents.cc index 2c1ba39..ab6a325 100644 --- a/chrome/browser/tab_contents/test_tab_contents.cc +++ b/chrome/browser/tab_contents/test_tab_contents.cc @@ -13,7 +13,7 @@ #include "chrome/common/notification_service.h" TestTabContents::TestTabContents(Profile* profile, SiteInstance* instance) - : TabContents(profile, instance, MSG_ROUTING_NONE, NULL), + : TabContents(profile, instance, MSG_ROUTING_NONE, NULL, NULL), transition_cross_site(false) { // Listen for infobar events so we can call InfoBarClosed() on the infobar // delegates and give them an opportunity to delete themselves. (Since we |