OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ |
6 #define CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 class LevelDBSnapshot { | 32 class LevelDBSnapshot { |
33 private: | 33 private: |
34 friend class LevelDBDatabase; | 34 friend class LevelDBDatabase; |
35 friend class LevelDBTransaction; | 35 friend class LevelDBTransaction; |
36 | 36 |
37 explicit LevelDBSnapshot(LevelDBDatabase* db); | 37 explicit LevelDBSnapshot(LevelDBDatabase* db); |
38 ~LevelDBSnapshot(); | 38 ~LevelDBSnapshot(); |
39 | 39 |
40 leveldb::DB* db_; | 40 leveldb::DB* db_; |
41 const leveldb::Snapshot* snapshot_; | 41 const leveldb::Snapshot* snapshot_; |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(LevelDBSnapshot); |
42 }; | 44 }; |
43 | 45 |
44 class CONTENT_EXPORT LevelDBLock { | 46 class CONTENT_EXPORT LevelDBLock { |
45 public: | 47 public: |
| 48 LevelDBLock() {} |
46 virtual ~LevelDBLock() {} | 49 virtual ~LevelDBLock() {} |
| 50 |
| 51 private: |
| 52 DISALLOW_COPY_AND_ASSIGN(LevelDBLock); |
47 }; | 53 }; |
48 | 54 |
49 class CONTENT_EXPORT LevelDBDatabase { | 55 class CONTENT_EXPORT LevelDBDatabase { |
50 public: | 56 public: |
51 class ComparatorAdapter : public leveldb::Comparator { | 57 class ComparatorAdapter : public leveldb::Comparator { |
52 public: | 58 public: |
53 explicit ComparatorAdapter(const LevelDBComparator* comparator); | 59 explicit ComparatorAdapter(const LevelDBComparator* comparator); |
54 | 60 |
55 virtual int Compare(const leveldb::Slice& a, | 61 virtual int Compare(const leveldb::Slice& a, |
56 const leveldb::Slice& b) const OVERRIDE; | 62 const leveldb::Slice& b) const OVERRIDE; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 103 |
98 scoped_ptr<leveldb::Env> env_; | 104 scoped_ptr<leveldb::Env> env_; |
99 scoped_ptr<leveldb::Comparator> comparator_adapter_; | 105 scoped_ptr<leveldb::Comparator> comparator_adapter_; |
100 scoped_ptr<leveldb::DB> db_; | 106 scoped_ptr<leveldb::DB> db_; |
101 const LevelDBComparator* comparator_; | 107 const LevelDBComparator* comparator_; |
102 }; | 108 }; |
103 | 109 |
104 } // namespace content | 110 } // namespace content |
105 | 111 |
106 #endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ | 112 #endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ |
OLD | NEW |