| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 leveldb::Status Put(const base::StringPiece& key, std::string* value); | 61 leveldb::Status Put(const base::StringPiece& key, std::string* value); |
| 62 leveldb::Status Remove(const base::StringPiece& key); | 62 leveldb::Status Remove(const base::StringPiece& key); |
| 63 virtual leveldb::Status Get(const base::StringPiece& key, | 63 virtual leveldb::Status Get(const base::StringPiece& key, |
| 64 std::string* value, | 64 std::string* value, |
| 65 bool* found, | 65 bool* found, |
| 66 const LevelDBSnapshot* = 0); | 66 const LevelDBSnapshot* = 0); |
| 67 leveldb::Status Write(const LevelDBWriteBatch& write_batch); | 67 leveldb::Status Write(const LevelDBWriteBatch& write_batch); |
| 68 scoped_ptr<LevelDBIterator> CreateIterator(const LevelDBSnapshot* = 0); | 68 scoped_ptr<LevelDBIterator> CreateIterator(const LevelDBSnapshot* = 0); |
| 69 const LevelDBComparator* Comparator() const; | 69 const LevelDBComparator* Comparator() const; |
| 70 void Compact(const base::StringPiece& start, const base::StringPiece& stop); | 70 void Compact(const base::StringPiece& start, const base::StringPiece& stop); |
| 71 void CompactAll(); |
| 71 | 72 |
| 72 protected: | 73 protected: |
| 73 LevelDBDatabase(); | 74 LevelDBDatabase(); |
| 74 | 75 |
| 75 private: | 76 private: |
| 76 friend class LevelDBSnapshot; | 77 friend class LevelDBSnapshot; |
| 77 | 78 |
| 78 scoped_ptr<leveldb::Env> env_; | 79 scoped_ptr<leveldb::Env> env_; |
| 79 scoped_ptr<leveldb::Comparator> comparator_adapter_; | 80 scoped_ptr<leveldb::Comparator> comparator_adapter_; |
| 80 scoped_ptr<leveldb::DB> db_; | 81 scoped_ptr<leveldb::DB> db_; |
| 81 const LevelDBComparator* comparator_; | 82 const LevelDBComparator* comparator_; |
| 82 }; | 83 }; |
| 83 | 84 |
| 84 } // namespace content | 85 } // namespace content |
| 85 | 86 |
| 86 #endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ | 87 #endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ |
| OLD | NEW |