| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PROTO_LEVELDB_DATABASE_H_ | 5 #ifndef COMPONENTS_LEVELDB_PROTO_LEVELDB_DATABASE_H_ |
| 6 #define COMPONENTS_LEVELDB_PROTO_LEVELDB_DATABASE_H_ | 6 #define COMPONENTS_LEVELDB_PROTO_LEVELDB_DATABASE_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "base/strings/string_split.h" | 14 #include "base/strings/string_split.h" |
| 15 #include "base/threading/thread_collision_warner.h" | 15 #include "base/threading/thread_collision_warner.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class HistogramBase; | 18 class HistogramBase; |
| 19 } // namespace base | 19 } // namespace base |
| 20 | 20 |
| 21 namespace leveldb { | 21 namespace leveldb { |
| 22 class DB; | 22 class DB; |
| 23 class Env; | 23 class Env; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 45 const std::vector<std::string>& keys_to_remove); | 45 const std::vector<std::string>& keys_to_remove); |
| 46 virtual bool Load(std::vector<std::string>* entries); | 46 virtual bool Load(std::vector<std::string>* entries); |
| 47 | 47 |
| 48 static bool Destroy(const base::FilePath& database_dir); | 48 static bool Destroy(const base::FilePath& database_dir); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 DFAKE_MUTEX(thread_checker_); | 51 DFAKE_MUTEX(thread_checker_); |
| 52 | 52 |
| 53 // The declaration order of these members matters: |db_| depends on |env_| and | 53 // The declaration order of these members matters: |db_| depends on |env_| and |
| 54 // therefore has to be destructed first. | 54 // therefore has to be destructed first. |
| 55 scoped_ptr<leveldb::Env> env_; | 55 std::unique_ptr<leveldb::Env> env_; |
| 56 scoped_ptr<leveldb::DB> db_; | 56 std::unique_ptr<leveldb::DB> db_; |
| 57 base::HistogramBase* open_histogram_; | 57 base::HistogramBase* open_histogram_; |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(LevelDB); | 59 DISALLOW_COPY_AND_ASSIGN(LevelDB); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace leveldb_proto | 62 } // namespace leveldb_proto |
| 63 | 63 |
| 64 #endif // COMPONENTS_LEVELDB_PROTO_LEVELDB_DATABASE_H_ | 64 #endif // COMPONENTS_LEVELDB_PROTO_LEVELDB_DATABASE_H_ |
| OLD | NEW |