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

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

Issue 2604273002: Migrate data from old localstorage format to new format. (Closed)
Patch Set: nit 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 6806302805ffbf4d11134bcb60da4e255ce6407d..b3deb4ef86ee38a1699f6d37a64fd0dc7144071e 100644
--- a/content/browser/dom_storage/local_storage_context_mojo.h
+++ b/content/browser/dom_storage/local_storage_context_mojo.h
@@ -20,6 +20,7 @@ class Connector;
namespace content {
+class DOMStorageTaskRunner;
class LevelDBWrapperImpl;
struct LocalStorageUsageInfo;
@@ -31,6 +32,8 @@ class CONTENT_EXPORT LocalStorageContextMojo {
base::OnceCallback<void(std::vector<LocalStorageUsageInfo>)>;
LocalStorageContextMojo(service_manager::Connector* connector,
+ scoped_refptr<DOMStorageTaskRunner> task_runner,
+ const base::FilePath& old_localstorage_path,
const base::FilePath& subdirectory);
~LocalStorageContextMojo();
@@ -45,15 +48,13 @@ class CONTENT_EXPORT LocalStorageContextMojo {
leveldb::mojom::LevelDBDatabaseAssociatedRequest DatabaseRequestForTesting();
private:
+ class LevelDBWrapperHolder;
+
// Runs |callback| immediately if already connected to a database, otherwise
// delays running |callback| untill after a connection has been established.
// Initiates connecting to the database if no connection is in progres yet.
void RunWhenConnected(base::OnceClosure callback);
- void OnLevelDBWrapperHasNoBindings(const url::Origin& origin);
- std::vector<leveldb::mojom::BatchedOperationPtr>
- OnLevelDBWrapperPrepareToCommit(const url::Origin& origin,
- const LevelDBWrapperImpl& wrapper);
void OnUserServiceConnectionComplete();
void OnUserServiceConnectionError();
@@ -107,7 +108,12 @@ class CONTENT_EXPORT LocalStorageContextMojo {
std::vector<base::OnceClosure> on_database_opened_callbacks_;
// Maps between an origin and its prefixed LevelDB view.
- std::map<url::Origin, std::unique_ptr<LevelDBWrapperImpl>> level_db_wrappers_;
+ std::map<url::Origin, std::unique_ptr<LevelDBWrapperHolder>>
+ level_db_wrappers_;
+
+ // Used to access old data for migration.
+ scoped_refptr<DOMStorageTaskRunner> task_runner_;
+ base::FilePath old_localstorage_path_;
base::WeakPtrFactory<LocalStorageContextMojo> weak_ptr_factory_;
};
« no previous file with comments | « content/browser/dom_storage/dom_storage_context_wrapper.cc ('k') | content/browser/dom_storage/local_storage_context_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698