| 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..4474a87ca644160a20e404eb200cf18900aaa25c 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,10 @@ class LevelDB {
|
|
|
| static bool Destroy(const base::FilePath& database_dir);
|
|
|
| + // base::trace_event::MemoryDumpProvider implementation.
|
| + bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& dump_args,
|
| + base::trace_event::ProcessMemoryDump* pmd) override;
|
| +
|
| private:
|
| DFAKE_MUTEX(thread_checker_);
|
|
|
| @@ -56,6 +61,8 @@ class LevelDB {
|
| std::unique_ptr<leveldb::Env> env_;
|
| std::unique_ptr<leveldb::DB> db_;
|
| base::HistogramBase* open_histogram_;
|
| + // Name of the client shown in chrome://tracing.
|
| + std::string client_name_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(LevelDB);
|
| };
|
|
|