| Index: components/leveldb/env_mojo.h
|
| diff --git a/components/leveldb/env_mojo.h b/components/leveldb/env_mojo.h
|
| index d784803324321735652be12bd77c44540a4ae91b..80d7ff0290a323561bad19e4e565f81568e3a10b 100644
|
| --- a/components/leveldb/env_mojo.h
|
| +++ b/components/leveldb/env_mojo.h
|
| @@ -5,6 +5,7 @@
|
| #ifndef COMPONENTS_LEVELDB_ENV_MOJO_H_
|
| #define COMPONENTS_LEVELDB_ENV_MOJO_H_
|
|
|
| +#include "base/id_map.h"
|
| #include "components/filesystem/public/interfaces/directory.mojom.h"
|
| #include "components/leveldb/leveldb_mojo_proxy.h"
|
| #include "third_party/leveldatabase/env_chromium.h"
|
| @@ -19,10 +20,13 @@ namespace leveldb {
|
| // existence.
|
| class MojoEnv : public leveldb_env::ChromiumEnv {
|
| public:
|
| - MojoEnv(const std::string& name,
|
| - scoped_refptr<LevelDBMojoProxy> file_thread,
|
| - LevelDBMojoProxy::OpaqueDir* dir);
|
| - ~MojoEnv() override;
|
| + static MojoEnv* Get(
|
| + scoped_refptr<base::SingleThreadTaskRunner> file_task_runner);
|
| +
|
| + // Registers a |directory| with the leveldb environment, returning a string
|
| + // that should be used as prefix to indicate files in that directory.
|
| + std::string RegisterDirectory(filesystem::mojom::DirectoryPtr directory);
|
| + void UnregisterDirectory(base::StringPiece prefix);
|
|
|
| // Overridden from leveldb_env::EnvChromium:
|
| Status NewSequentialFile(const std::string& fname,
|
| @@ -50,8 +54,15 @@ class MojoEnv : public leveldb_env::ChromiumEnv {
|
| // NowMicros() or SleepForMicroseconds() and use the EnvChromium versions.
|
|
|
| private:
|
| + MojoEnv(scoped_refptr<base::SingleThreadTaskRunner> file_task_runner);
|
| + ~MojoEnv() override;
|
| +
|
| + void ParsePath(const std::string& path,
|
| + LevelDBMojoProxy::OpaqueDir** out_dir,
|
| + std::string* out_path);
|
| +
|
| scoped_refptr<LevelDBMojoProxy> thread_;
|
| - LevelDBMojoProxy::OpaqueDir* dir_;
|
| + IDMap<LevelDBMojoProxy::OpaqueDir*> dirs_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(MojoEnv);
|
| };
|
|
|