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

Unified Diff: components/leveldb/leveldb_database_impl.cc

Issue 2953473002: Use leveldb_env::OpenDB() to open leveldb databases. (Closed)
Patch Set: Rebase; add comments to CHECK() 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
« no previous file with comments | « components/drive/resource_metadata_storage.cc ('k') | components/leveldb/leveldb_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/leveldb/leveldb_database_impl.cc
diff --git a/components/leveldb/leveldb_database_impl.cc b/components/leveldb/leveldb_database_impl.cc
index d8ae4e25db235abfe7772f310d783def3e637536..f0f509a28c66dea0e215ccac63831ff90f14fdf8 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"
@@ -310,11 +311,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_);
« no previous file with comments | « components/drive/resource_metadata_storage.cc ('k') | components/leveldb/leveldb_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698