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

Unified Diff: components/leveldb/env_mojo.cc

Issue 1839823002: mojo leveldb: Remove the created file thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: And cut out manual Signal()ing most places. Created 4 years, 9 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
« no previous file with comments | « components/leveldb/env_mojo.h ('k') | components/leveldb/leveldb.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/leveldb/env_mojo.cc
diff --git a/components/leveldb/env_mojo.cc b/components/leveldb/env_mojo.cc
index 6553722f10d87e49c8cc9873a6e26b76ab32b897..089202f0d2fff1647577f60fe543812d4e31da17 100644
--- a/components/leveldb/env_mojo.cc
+++ b/components/leveldb/env_mojo.cc
@@ -41,21 +41,21 @@ Status FilesystemErrorToStatus(filesystem::FileError error,
class MojoFileLock : public FileLock {
public:
- MojoFileLock(LevelDBFileThread::OpaqueLock* lock, const std::string& name)
+ MojoFileLock(LevelDBMojoProxy::OpaqueLock* lock, const std::string& name)
: fname_(name), lock_(lock) {}
~MojoFileLock() override { DCHECK(!lock_); }
const std::string& name() const { return fname_; }
- LevelDBFileThread::OpaqueLock* TakeLock() {
- LevelDBFileThread::OpaqueLock* to_return = lock_;
+ LevelDBMojoProxy::OpaqueLock* TakeLock() {
+ LevelDBMojoProxy::OpaqueLock* to_return = lock_;
lock_ = nullptr;
return to_return;
}
private:
std::string fname_;
- LevelDBFileThread::OpaqueLock* lock_;
+ LevelDBMojoProxy::OpaqueLock* lock_;
};
class MojoSequentialFile : public leveldb::SequentialFile {
@@ -125,10 +125,10 @@ class MojoRandomAccessFile : public leveldb::RandomAccessFile {
class MojoWritableFile : public leveldb::WritableFile {
public:
- MojoWritableFile(LevelDBFileThread::OpaqueDir* dir,
+ MojoWritableFile(LevelDBMojoProxy::OpaqueDir* dir,
const std::string& fname,
base::File f,
- scoped_refptr<LevelDBFileThread> thread)
+ scoped_refptr<LevelDBMojoProxy> thread)
: filename_(fname),
file_(std::move(f)),
file_type_(kOther),
@@ -202,20 +202,18 @@ class MojoWritableFile : public leveldb::WritableFile {
std::string filename_;
base::File file_;
Type file_type_;
- LevelDBFileThread::OpaqueDir* dir_;
+ LevelDBMojoProxy::OpaqueDir* dir_;
std::string parent_dir_;
- scoped_refptr<LevelDBFileThread> thread_;
+ scoped_refptr<LevelDBMojoProxy> thread_;
DISALLOW_COPY_AND_ASSIGN(MojoWritableFile);
};
} // namespace
-MojoEnv::MojoEnv(scoped_refptr<LevelDBFileThread> file_thread,
- LevelDBFileThread::OpaqueDir* dir)
- : thread_(file_thread),
- dir_(dir) {
-}
+MojoEnv::MojoEnv(scoped_refptr<LevelDBMojoProxy> file_thread,
+ LevelDBMojoProxy::OpaqueDir* dir)
+ : thread_(file_thread), dir_(dir) {}
MojoEnv::~MojoEnv() {
thread_->UnregisterDirectory(dir_);
@@ -333,7 +331,7 @@ Status MojoEnv::RenameFile(const std::string& src, const std::string& target) {
Status MojoEnv::LockFile(const std::string& fname, FileLock** lock) {
TRACE_EVENT1("leveldb", "MojoEnv::LockFile", "fname", fname);
- std::pair<filesystem::FileError, LevelDBFileThread::OpaqueLock*> p =
+ std::pair<filesystem::FileError, LevelDBMojoProxy::OpaqueLock*> p =
thread_->LockFile(dir_, mojo::String::From(fname));
if (p.second)
« no previous file with comments | « components/leveldb/env_mojo.h ('k') | components/leveldb/leveldb.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698