| 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 explicit LevelDBSnapshot(LevelDBDatabase* db); | 36 explicit LevelDBSnapshot(LevelDBDatabase* db); |
| 37 ~LevelDBSnapshot(); | 37 ~LevelDBSnapshot(); |
| 38 | 38 |
| 39 leveldb::DB* db_; | 39 leveldb::DB* db_; |
| 40 const leveldb::Snapshot* snapshot_; | 40 const leveldb::Snapshot* snapshot_; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 class CONTENT_EXPORT LevelDBDatabase { | 43 class CONTENT_EXPORT LevelDBDatabase { |
| 44 public: | 44 public: |
| 45 static scoped_ptr<LevelDBDatabase> Open(const base::FilePath& file_name, | 45 static scoped_ptr<LevelDBDatabase> Open(const base::FilePath& file_name, |
| 46 const LevelDBComparator* comparator); | 46 const LevelDBComparator* comparator, |
| 47 bool* is_disk_full = 0); |
| 47 static scoped_ptr<LevelDBDatabase> OpenInMemory( | 48 static scoped_ptr<LevelDBDatabase> OpenInMemory( |
| 48 const LevelDBComparator* comparator); | 49 const LevelDBComparator* comparator); |
| 49 static bool Destroy(const base::FilePath& file_name); | 50 static bool Destroy(const base::FilePath& file_name); |
| 50 virtual ~LevelDBDatabase(); | 51 virtual ~LevelDBDatabase(); |
| 51 | 52 |
| 52 bool Put(const LevelDBSlice& key, const std::vector<char>& value); | 53 bool Put(const LevelDBSlice& key, const std::vector<char>& value); |
| 53 bool Remove(const LevelDBSlice& key); | 54 bool Remove(const LevelDBSlice& key); |
| 54 virtual bool Get(const LevelDBSlice& key, | 55 virtual bool Get(const LevelDBSlice& key, |
| 55 std::string* value, | 56 std::string* value, |
| 56 bool* found, | 57 bool* found, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 67 | 68 |
| 68 scoped_ptr<leveldb::Env> env_; | 69 scoped_ptr<leveldb::Env> env_; |
| 69 scoped_ptr<leveldb::Comparator> comparator_adapter_; | 70 scoped_ptr<leveldb::Comparator> comparator_adapter_; |
| 70 scoped_ptr<leveldb::DB> db_; | 71 scoped_ptr<leveldb::DB> db_; |
| 71 const LevelDBComparator* comparator_; | 72 const LevelDBComparator* comparator_; |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 } // namespace content | 75 } // namespace content |
| 75 | 76 |
| 76 #endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ | 77 #endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ |
| OLD | NEW |