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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/unguessable_token.h" | 10 #include "base/unguessable_token.h" |
11 #include "components/leveldb/public/interfaces/leveldb.mojom.h" | 11 #include "components/leveldb/public/interfaces/leveldb.mojom.h" |
12 #include "mojo/public/cpp/bindings/interface_request.h" | 12 #include "mojo/public/cpp/bindings/interface_request.h" |
13 #include "third_party/leveldatabase/src/include/leveldb/db.h" | 13 #include "third_party/leveldatabase/src/include/leveldb/db.h" |
14 | 14 |
15 namespace leveldb { | 15 namespace leveldb { |
16 | 16 |
17 class MojoEnv; | |
18 | |
19 // The backing to a database object that we pass to our called. | 17 // The backing to a database object that we pass to our called. |
20 class LevelDBDatabaseImpl : public mojom::LevelDBDatabase { | 18 class LevelDBDatabaseImpl : public mojom::LevelDBDatabase { |
21 public: | 19 public: |
22 LevelDBDatabaseImpl(std::unique_ptr<leveldb::Env> environment, | 20 LevelDBDatabaseImpl(std::unique_ptr<leveldb::Env> environment, |
23 std::unique_ptr<leveldb::DB> db); | 21 std::unique_ptr<leveldb::DB> db); |
24 ~LevelDBDatabaseImpl() override; | 22 ~LevelDBDatabaseImpl() override; |
25 | 23 |
26 // Overridden from LevelDBDatabase: | 24 // Overridden from LevelDBDatabase: |
27 void Put(const std::vector<uint8_t>& key, | 25 void Put(const std::vector<uint8_t>& key, |
28 const std::vector<uint8_t>& value, | 26 const std::vector<uint8_t>& value, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // system, but this maybe should be fixed... | 79 // system, but this maybe should be fixed... |
82 | 80 |
83 std::map<base::UnguessableToken, Iterator*> iterator_map_; | 81 std::map<base::UnguessableToken, Iterator*> iterator_map_; |
84 | 82 |
85 DISALLOW_COPY_AND_ASSIGN(LevelDBDatabaseImpl); | 83 DISALLOW_COPY_AND_ASSIGN(LevelDBDatabaseImpl); |
86 }; | 84 }; |
87 | 85 |
88 } // namespace leveldb | 86 } // namespace leveldb |
89 | 87 |
90 #endif // COMPONENTS_LEVELDB_LEVELDB_DATABASE_IMPL_H_ | 88 #endif // COMPONENTS_LEVELDB_LEVELDB_DATABASE_IMPL_H_ |
OLD | NEW |