Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Unified Diff: components/leveldb/leveldb_database_impl.cc

Issue 2953473002: Use leveldb_env::OpenDB() to open leveldb databases. (Closed)
Patch Set: Use OpenDB in unittests; add allocation edges Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/leveldb/leveldb_database_impl.cc
diff --git a/components/leveldb/leveldb_database_impl.cc b/components/leveldb/leveldb_database_impl.cc
index 02b1a2d83cc70f4c49b5f5e8680fd6bc80acafbb..d7ff2298de7eaf7b14553021fb4c0eb9b19ea9a9 100644
--- a/components/leveldb/leveldb_database_impl.cc
+++ b/components/leveldb/leveldb_database_impl.cc
@@ -16,6 +16,7 @@
#include "base/trace_event/memory_dump_manager.h"
#include "components/leveldb/env_mojo.h"
#include "components/leveldb/public/cpp/util.h"
+#include "third_party/leveldatabase/env_chromium.h"
#include "third_party/leveldatabase/src/include/leveldb/db.h"
#include "third_party/leveldatabase/src/include/leveldb/write_batch.h"
@@ -308,11 +309,10 @@ bool LevelDBDatabaseImpl::OnMemoryDump(
cache_->TotalCharge());
}
- const char* system_allocator_name =
- base::trace_event::MemoryDumpManager::GetInstance()
- ->system_allocator_pool_name();
- if (system_allocator_name)
- pmd->AddSuballocation(mad->guid(), system_allocator_name);
+ // All leveldb databases are already dumped by leveldb_env::DBTracker. Add
+ // an edge to avoid double counting.
+ pmd->AddSuballocation(mad->guid(),
+ leveldb_env::DBTracker::GetMemoryDumpName(db_.get()));
if (memory_dump_id_) {
auto* global_dump = pmd->CreateSharedGlobalAllocatorDump(*memory_dump_id_);

Powered by Google App Engine
This is Rietveld 408576698