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

Unified Diff: chrome/browser/sessions/session_restore.cc

Issue 9963107: Persist sessionStorage on disk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review (pkasting) 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
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/ui/startup/session_crashed_prompt.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_restore.cc
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc
index 5298b08da7e3da8ecf9ad7d3e31b42b19b1d741f..73515443fa5fc7e50af3468bd79127a6e3ab2aea 100644
--- a/chrome/browser/sessions/session_restore.cc
+++ b/chrome/browser/sessions/session_restore.cc
@@ -733,7 +733,10 @@ class SessionRestoreImpl : public content::NotificationObserver {
100);
if (windows->empty()) {
- // Restore was unsuccessful.
+ // Restore was unsuccessful. The DOM storage system can also delete its
+ // data, since no session restore will happen at a later point in time.
+ content::BrowserContext::GetDefaultDOMStorageContext(profile_)->
+ StartScavengingUnusedSessionStorage();
return FinishedTabCreation(false, false);
}
@@ -822,6 +825,12 @@ class SessionRestoreImpl : public content::NotificationObserver {
Browser* finished_browser = FinishedTabCreation(true, has_tabbed_browser);
if (finished_browser)
last_browser = finished_browser;
+
+ // sessionStorages needed for the session restore have now been recreated
+ // by RestoreTab. Now it's safe for the DOM storage system to start
+ // deleting leftover data.
+ content::BrowserContext::GetDefaultDOMStorageContext(profile_)->
+ StartScavengingUnusedSessionStorage();
return last_browser;
}
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/ui/startup/session_crashed_prompt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698