| 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_;
|
| };
|
|
|