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

Unified Diff: webkit/database/database_tracker.cc

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
« no previous file with comments | « webkit/database/database_tracker.h ('k') | webkit/database/database_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/database/database_tracker.cc
diff --git a/webkit/database/database_tracker.cc b/webkit/database/database_tracker.cc
index 8e09d167203f036b62878bd87283002af9bb09ec..980e8a16f0de4b6a0e3971c738db963f2bf476d0 100644
--- a/webkit/database/database_tracker.cc
+++ b/webkit/database/database_tracker.cc
@@ -100,6 +100,7 @@ DatabaseTracker::DatabaseTracker(
: is_initialized_(false),
is_incognito_(is_incognito),
clear_local_state_on_exit_(clear_local_state_on_exit),
+ save_session_state_(false),
shutting_down_(false),
profile_path_(profile_path),
db_dir_(is_incognito_ ?
@@ -857,7 +858,7 @@ void DatabaseTracker::Shutdown() {
}
if (is_incognito_)
DeleteIncognitoDBDirectory();
- else
+ else if (!save_session_state_)
ClearLocalState(clear_local_state_on_exit_);
}
@@ -877,4 +878,15 @@ void DatabaseTracker::SetClearLocalStateOnExit(bool clear_local_state_on_exit) {
clear_local_state_on_exit_ = clear_local_state_on_exit;
}
+void DatabaseTracker::SaveSessionState() {
+ DCHECK(db_tracker_thread_.get());
+ if (!db_tracker_thread_->BelongsToCurrentThread()) {
+ db_tracker_thread_->PostTask(
+ FROM_HERE,
+ base::Bind(&DatabaseTracker::SaveSessionState, this));
+ return;
+ }
+ save_session_state_ = true;
+}
+
} // namespace webkit_database
« no previous file with comments | « webkit/database/database_tracker.h ('k') | webkit/database/database_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698