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

Unified Diff: components/leveldb/leveldb_service_impl.cc

Issue 1720603002: Revert of mojo: Get mojo:leveldb and mojo:filesystem compiled into content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/leveldb_service_impl.h ('k') | content/browser/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/leveldb/leveldb_service_impl.cc
diff --git a/components/leveldb/leveldb_service_impl.cc b/components/leveldb/leveldb_service_impl.cc
deleted file mode 100644
index 404019e9992ffa0050dd3a5cae7c81c1c64afa7a..0000000000000000000000000000000000000000
--- a/components/leveldb/leveldb_service_impl.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/leveldb/leveldb_service_impl.h"
-
-#include "components/leveldb/env_mojo.h"
-#include "components/leveldb/leveldb_database_impl.h"
-#include "components/leveldb/util.h"
-#include "third_party/leveldatabase/env_chromium.h"
-#include "third_party/leveldatabase/src/include/leveldb/db.h"
-#include "third_party/leveldatabase/src/include/leveldb/env.h"
-#include "third_party/leveldatabase/src/include/leveldb/filter_policy.h"
-#include "third_party/leveldatabase/src/include/leveldb/slice.h"
-
-namespace leveldb {
-
-LevelDBServiceImpl::LevelDBServiceImpl()
- : thread_(new LevelDBFileThread) {
-}
-
-LevelDBServiceImpl::~LevelDBServiceImpl() {}
-
-void LevelDBServiceImpl::Open(filesystem::DirectoryPtr directory,
- const mojo::String& dbname,
- mojo::InterfaceRequest<LevelDBDatabase> database,
- const OpenCallback& callback) {
- // This is the place where we open a database.
- leveldb::Options options;
- options.create_if_missing = true;
- options.paranoid_checks = true;
- // TODO(erg): Do we need a filter policy?
- options.reuse_logs = leveldb_env::kDefaultLogReuseOptionValue;
- options.compression = leveldb::kSnappyCompression;
-
- // For info about the troubles we've run into with this parameter, see:
- // https://code.google.com/p/chromium/issues/detail?id=227313#c11
- options.max_open_files = 80;
-
- // Register our directory with the file thread.
- LevelDBFileThread::OpaqueDir* dir =
- thread_->RegisterDirectory(std::move(directory));
-
- scoped_ptr<MojoEnv> env_mojo(new MojoEnv(thread_, dir));
- options.env = env_mojo.get();
-
- leveldb::DB* db = nullptr;
- leveldb::Status s = leveldb::DB::Open(options, dbname.To<std::string>(), &db);
-
- if (s.ok()) {
- new LevelDBDatabaseImpl(std::move(database), std::move(env_mojo),
- scoped_ptr<leveldb::DB>(db));
- }
-
- callback.Run(LeveldbStatusToError(s));
-}
-
-} // namespace leveldb
« no previous file with comments | « components/leveldb/leveldb_service_impl.h ('k') | content/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698