| 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 #ifndef COMPONENTS_LEVELDB_LEVELDB_DATABASE_IMPL_H_ | 5 #ifndef COMPONENTS_LEVELDB_LEVELDB_DATABASE_IMPL_H_ |
| 6 #define COMPONENTS_LEVELDB_LEVELDB_DATABASE_IMPL_H_ | 6 #define COMPONENTS_LEVELDB_LEVELDB_DATABASE_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "components/leveldb/public/interfaces/leveldb.mojom.h" | 9 #include "components/leveldb/public/interfaces/leveldb.mojom.h" |
| 10 #include "mojo/public/cpp/bindings/interface_request.h" | 10 #include "mojo/public/cpp/bindings/interface_request.h" |
| 11 #include "mojo/public/cpp/bindings/strong_binding.h" | 11 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 12 #include "third_party/leveldatabase/src/include/leveldb/db.h" | 12 #include "third_party/leveldatabase/src/include/leveldb/db.h" |
| 13 | 13 |
| 14 namespace leveldb { | 14 namespace leveldb { |
| 15 | 15 |
| 16 class MojoEnv; | 16 class MojoEnv; |
| 17 | 17 |
| 18 // The backing to a database object that we pass to our called. | 18 // The backing to a database object that we pass to our called. |
| 19 class LevelDBDatabaseImpl : public LevelDBDatabase { | 19 class LevelDBDatabaseImpl : public LevelDBDatabase { |
| 20 public: | 20 public: |
| 21 LevelDBDatabaseImpl(mojo::InterfaceRequest<LevelDBDatabase> request, | 21 LevelDBDatabaseImpl(leveldb::LevelDBDatabaseRequest request, |
| 22 scoped_ptr<MojoEnv> environment, | 22 scoped_ptr<MojoEnv> environment, |
| 23 scoped_ptr<leveldb::DB> db); | 23 scoped_ptr<leveldb::DB> db); |
| 24 ~LevelDBDatabaseImpl() override; | 24 ~LevelDBDatabaseImpl() override; |
| 25 | 25 |
| 26 // Overridden from LevelDBDatabase: | 26 // Overridden from LevelDBDatabase: |
| 27 void Put(mojo::Array<uint8_t> key, | 27 void Put(mojo::Array<uint8_t> key, |
| 28 mojo::Array<uint8_t> value, | 28 mojo::Array<uint8_t> value, |
| 29 const PutCallback& callback) override; | 29 const PutCallback& callback) override; |
| 30 void Delete(mojo::Array<uint8_t> key, | 30 void Delete(mojo::Array<uint8_t> key, |
| 31 const DeleteCallback& callback) override; | 31 const DeleteCallback& callback) override; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 51 // system, but this maybe should be fixed... | 51 // system, but this maybe should be fixed... |
| 52 | 52 |
| 53 std::map<uint64_t, Iterator*> iterator_map_; | 53 std::map<uint64_t, Iterator*> iterator_map_; |
| 54 | 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(LevelDBDatabaseImpl); | 55 DISALLOW_COPY_AND_ASSIGN(LevelDBDatabaseImpl); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 } // namespace leveldb | 58 } // namespace leveldb |
| 59 | 59 |
| 60 #endif // COMPONENTS_LEVELDB_LEVELDB_DATABASE_IMPL_H_ | 60 #endif // COMPONENTS_LEVELDB_LEVELDB_DATABASE_IMPL_H_ |
| OLD | NEW |