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

Unified Diff: content/browser/dom_storage/local_storage_context_mojo.h

Issue 2625873004: Delete and try to recreate localstorage database on invalid schema version. (Closed)
Patch Set: Created 3 years, 11 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: content/browser/dom_storage/local_storage_context_mojo.h
diff --git a/content/browser/dom_storage/local_storage_context_mojo.h b/content/browser/dom_storage/local_storage_context_mojo.h
index e9d2f532952e86e484bad1761a59273df192f99c..272112125a60cce331f74d3835adc9324a8f8b00 100644
--- a/content/browser/dom_storage/local_storage_context_mojo.h
+++ b/content/browser/dom_storage/local_storage_context_mojo.h
@@ -57,11 +57,16 @@ class CONTENT_EXPORT LocalStorageContextMojo {
void OnUserServiceConnectionComplete();
void OnUserServiceConnectionError();
- // Part of our asynchronous directory opening called from OpenLocalStorage().
+ // Part of our asynchronous directory opening called from RunWhenConnected().
+ void InitiateConnection(bool in_memory_only = false);
void OnDirectoryOpened(filesystem::mojom::FileError err);
void OnDatabaseOpened(leveldb::mojom::DatabaseError status);
void OnGotDatabaseVersion(leveldb::mojom::DatabaseError status,
const std::vector<uint8_t>& value);
+ void OnConnectionFinished();
+ void DeleteAndRecreateDatabase();
+ void OnDBDestroyed(bool recreate_in_memory,
+ leveldb::mojom::DatabaseError status);
// The (possibly delayed) implementation of OpenLocalStorage(). Can be called
// directly from that function, or through |on_database_open_callbacks_|.
@@ -97,6 +102,7 @@ class CONTENT_EXPORT LocalStorageContextMojo {
leveldb::mojom::LevelDBServicePtr leveldb_service_;
leveldb::mojom::LevelDBDatabasePtr database_;
+ bool tried_to_recreate_ = false;
std::vector<base::OnceClosure> on_database_opened_callbacks_;

Powered by Google App Engine
This is Rietveld 408576698