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

Unified Diff: content/browser/in_process_webkit/indexed_db_context.h

Issue 8820009: Appcache, local storage, indexed db, databases: skip exit-time deletion when restarting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review. Created 9 years 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: content/browser/in_process_webkit/indexed_db_context.h
diff --git a/content/browser/in_process_webkit/indexed_db_context.h b/content/browser/in_process_webkit/indexed_db_context.h
index 5796fb058174c3656cc46be589adfb3fb92860b4..99aedc16ff47338c9cc457b176208aa82935340d 100644
--- a/content/browser/in_process_webkit/indexed_db_context.h
+++ b/content/browser/in_process_webkit/indexed_db_context.h
@@ -59,6 +59,11 @@ class CONTENT_EXPORT IndexedDBContext
clear_local_state_on_exit_ = clear_local_state;
}
+ // Disables the exit-time deletion for all data (also session-only data).
+ void SaveSessionState() {
+ save_session_state_ = true;
+ }
+
// Deletes all indexed db files for the given origin.
void DeleteIndexedDBForOrigin(const GURL& origin_url);
@@ -86,6 +91,7 @@ class CONTENT_EXPORT IndexedDBContext
FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, ClearAppData);
FRIEND_TEST_ALL_PREFIXES(IndexedDBBrowserTest, ClearLocalState);
FRIEND_TEST_ALL_PREFIXES(IndexedDBBrowserTest, ClearSessionOnlyDatabases);
+ FRIEND_TEST_ALL_PREFIXES(IndexedDBBrowserTest, SaveSessionState);
friend class IndexedDBQuotaClientTest;
typedef std::map<GURL, int64> OriginToSizeMap;
@@ -118,6 +124,8 @@ class CONTENT_EXPORT IndexedDBContext
scoped_ptr<WebKit::WebIDBFactory> idb_factory_;
FilePath data_path_;
bool clear_local_state_on_exit_;
+ // If true, nothing (not even session-only data) should be deleted on exit.
+ bool save_session_state_;
scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_;
scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_;
scoped_ptr<std::set<GURL> > origin_set_;
« no previous file with comments | « content/browser/in_process_webkit/indexed_db_browsertest.cc ('k') | content/browser/in_process_webkit/indexed_db_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698