| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/leveldb/leveldb_service_impl.h" | 5 #include "components/leveldb/leveldb_service_impl.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/single_thread_task_runner.h" |
| 10 #include "components/leveldb/env_mojo.h" | 11 #include "components/leveldb/env_mojo.h" |
| 11 #include "components/leveldb/leveldb_database_impl.h" | 12 #include "components/leveldb/leveldb_database_impl.h" |
| 12 #include "components/leveldb/public/cpp/util.h" | 13 #include "components/leveldb/public/cpp/util.h" |
| 13 #include "mojo/public/cpp/bindings/strong_associated_binding.h" | 14 #include "mojo/public/cpp/bindings/strong_associated_binding.h" |
| 14 #include "third_party/leveldatabase/env_chromium.h" | 15 #include "third_party/leveldatabase/env_chromium.h" |
| 15 #include "third_party/leveldatabase/src/helpers/memenv/memenv.h" | 16 #include "third_party/leveldatabase/src/helpers/memenv/memenv.h" |
| 16 #include "third_party/leveldatabase/src/include/leveldb/db.h" | 17 #include "third_party/leveldatabase/src/include/leveldb/db.h" |
| 17 #include "third_party/leveldatabase/src/include/leveldb/env.h" | 18 #include "third_party/leveldatabase/src/include/leveldb/env.h" |
| 18 #include "third_party/leveldatabase/src/include/leveldb/filter_policy.h" | 19 #include "third_party/leveldatabase/src/include/leveldb/filter_policy.h" |
| 19 #include "third_party/leveldatabase/src/include/leveldb/slice.h" | 20 #include "third_party/leveldatabase/src/include/leveldb/slice.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 leveldb::Options options; | 101 leveldb::Options options; |
| 101 // Register our directory with the file thread. | 102 // Register our directory with the file thread. |
| 102 LevelDBMojoProxy::OpaqueDir* dir = | 103 LevelDBMojoProxy::OpaqueDir* dir = |
| 103 thread_->RegisterDirectory(std::move(directory)); | 104 thread_->RegisterDirectory(std::move(directory)); |
| 104 std::unique_ptr<MojoEnv> env_mojo(new MojoEnv(thread_, dir)); | 105 std::unique_ptr<MojoEnv> env_mojo(new MojoEnv(thread_, dir)); |
| 105 options.env = env_mojo.get(); | 106 options.env = env_mojo.get(); |
| 106 callback.Run(LeveldbStatusToError(leveldb::DestroyDB(dbname, options))); | 107 callback.Run(LeveldbStatusToError(leveldb::DestroyDB(dbname, options))); |
| 107 } | 108 } |
| 108 | 109 |
| 109 } // namespace leveldb | 110 } // namespace leveldb |
| OLD | NEW |