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 236b0b82230db90f1026ea304e7d386741f6da73..5c0705b97bec556100dbf84b3423595d61797ab1 100644 |
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
@@ -68,7 +68,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" |
@@ -563,6 +565,17 @@ bool StartupBrowserCreatorImpl::ProcessStartupURLs( |
return false; |
AddInfoBarsIfNecessary(browser, browser::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(); |
+ } |
+ |
return true; |
} |