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

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: 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/ui/startup/session_crashed_prompt.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f143d255fbd21f472b6533f3e62fe19013bb10dc..adcb2f366181de34fb85c5084bf6f867a1759888 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -73,6 +73,7 @@
#include "chrome/common/url_constants.h"
#include "chrome/installer/util/browser_distribution.h"
#include "content/public/browser/child_process_security_policy.h"
+#include "content/public/browser/dom_storage_context.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents.h"
@@ -630,6 +631,16 @@ 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::BrowserContext::GetDefaultDOMStorageContext(profile_)->
+ StartScavengingUnusedSessionStorage();
+ }
+
return true;
}
« no previous file with comments | « chrome/browser/ui/startup/session_crashed_prompt.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698