| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 static scoped_ptr<LevelDBDatabase> Open(const base::FilePath& file_name, | 44 static scoped_ptr<LevelDBDatabase> Open(const base::FilePath& file_name, |
| 45 const LevelDBComparator* comparator); | 45 const LevelDBComparator* comparator); |
| 46 static scoped_ptr<LevelDBDatabase> OpenInMemory( | 46 static scoped_ptr<LevelDBDatabase> OpenInMemory( |
| 47 const LevelDBComparator* comparator); | 47 const LevelDBComparator* comparator); |
| 48 static bool Destroy(const base::FilePath& file_name); | 48 static bool Destroy(const base::FilePath& file_name); |
| 49 virtual ~LevelDBDatabase(); | 49 virtual ~LevelDBDatabase(); |
| 50 | 50 |
| 51 bool Put(const LevelDBSlice& key, const std::vector<char>& value); | 51 bool Put(const LevelDBSlice& key, const std::vector<char>& value); |
| 52 bool Remove(const LevelDBSlice& key); | 52 bool Remove(const LevelDBSlice& key); |
| 53 virtual bool Get(const LevelDBSlice& key, | 53 virtual bool Get(const LevelDBSlice& key, |
| 54 std::vector<char>& value, | 54 std::string* value, |
| 55 bool& found, | 55 bool& found, |
| 56 const LevelDBSnapshot* = 0); | 56 const LevelDBSnapshot* = 0); |
| 57 bool Write(LevelDBWriteBatch& batch); | 57 bool Write(LevelDBWriteBatch& batch); |
| 58 scoped_ptr<LevelDBIterator> CreateIterator(const LevelDBSnapshot* = 0); | 58 scoped_ptr<LevelDBIterator> CreateIterator(const LevelDBSnapshot* = 0); |
| 59 const LevelDBComparator* Comparator() const; | 59 const LevelDBComparator* Comparator() const; |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 LevelDBDatabase(); | 62 LevelDBDatabase(); |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 friend class LevelDBSnapshot; | 65 friend class LevelDBSnapshot; |
| 66 | 66 |
| 67 scoped_ptr<leveldb::Env> env_; | 67 scoped_ptr<leveldb::Env> env_; |
| 68 scoped_ptr<leveldb::Comparator> comparator_adapter_; | 68 scoped_ptr<leveldb::Comparator> comparator_adapter_; |
| 69 scoped_ptr<leveldb::DB> db_; | 69 scoped_ptr<leveldb::DB> db_; |
| 70 const LevelDBComparator* comparator_; | 70 const LevelDBComparator* comparator_; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 } // namespace content | 73 } // namespace content |
| 74 | 74 |
| 75 #endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ | 75 #endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ |
| OLD | NEW |