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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 9963107: Persist sessionStorage on disk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 8 years, 5 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/ui/startup/startup_browser_creator_impl.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index 1b9188f90671b28aff69ba53d45e451844ff9ed6..1323d41f155207f31b5f3aba5eeb27268b16995d 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -70,7 +70,9 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/installer/util/browser_distribution.h"
+#include "content/public/browser/browser_context.h"
#include "content/public/browser/child_process_security_policy.h"
+#include "content/public/browser/dom_storage_context.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "grit/locale_settings.h"
@@ -578,6 +580,17 @@ bool StartupBrowserCreatorImpl::ProcessStartupURLs(
return false;
AddInfoBarsIfNecessary(browser, chrome::startup::IS_PROCESS_STARTUP);
+
+ // Session restore may occur if the startup preference is "last" or if the
+ // crash infobar is displayed. Otherwise, it's safe for the DOM storage system
+ // to start deleting leftover data.
+ if (pref.type != SessionStartupPref::LAST &&
+ !HasPendingUncleanExit(profile_)) {
+ content::DOMStorageContext* dom_storage_context =
+ content::BrowserContext::GetDOMStorageContext(profile_);
+ dom_storage_context->StartScavengingUnusedSessionStorage();
michaeln 2012/07/10 01:16:58 It's unfortunate there are so many places where th
marja 2012/07/10 13:40:52 Ack. The knowledge on "now we're sure that the ses
+ }
+
return true;
}

Powered by Google App Engine
This is Rietveld 408576698