Chromium Code Reviews| Index: components/leveldb_proto/leveldb_database.h |
| diff --git a/components/leveldb_proto/leveldb_database.h b/components/leveldb_proto/leveldb_database.h |
| index a3caf2f932ae6ee16217bbca2bc016858c08d82d..8ac2416835f2e8b5fcfb59b65845d80ba2a7502e 100644 |
| --- a/components/leveldb_proto/leveldb_database.h |
| +++ b/components/leveldb_proto/leveldb_database.h |
| @@ -13,6 +13,7 @@ |
| #include "base/macros.h" |
| #include "base/strings/string_split.h" |
| #include "base/threading/thread_collision_warner.h" |
| +#include "base/trace_event/memory_dump_provider.h" |
| namespace base { |
| class HistogramBase; |
| @@ -29,14 +30,14 @@ namespace leveldb_proto { |
| // Interacts with the LevelDB third party module. |
| // Once constructed, function calls and destruction should all occur on the |
| // same thread (not necessarily the same as the constructor). |
| -class LevelDB { |
| +class LevelDB : base::trace_event::MemoryDumpProvider { |
| public: |
| // Constructor. Does *not* open a leveldb - only initialize this class. |
| // |client_name| is the name of the "client" that owns this instance. Used |
| // for UMA statics as so: LevelDB.<value>.<client name>. It is best to not |
| // change once shipped. |
| explicit LevelDB(const char* client_name); |
| - virtual ~LevelDB(); |
| + ~LevelDB() override; |
| virtual bool InitWithOptions(const base::FilePath& database_dir, |
| const leveldb::Options& options); |
| @@ -48,6 +49,9 @@ class LevelDB { |
| static bool Destroy(const base::FilePath& database_dir); |
| + bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& dump_args, |
| + base::trace_event::ProcessMemoryDump* pmd) override; |
| + |
| private: |
| DFAKE_MUTEX(thread_checker_); |
| @@ -56,6 +60,7 @@ class LevelDB { |
| std::unique_ptr<leveldb::Env> env_; |
| std::unique_ptr<leveldb::DB> db_; |
| base::HistogramBase* open_histogram_; |
| + std::string client_name_; |
|
nyquist
2016/09/21 06:04:16
Could you add a comment as to what this is used fo
ssid
2016/09/21 19:08:50
Done.
|
| DISALLOW_COPY_AND_ASSIGN(LevelDB); |
| }; |