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

Unified Diff: net/disk_cache/simple/simple_index.cc

Issue 2661333002: Track SimpleCache memory usage in net/ MemoryDumpProvider (Closed)
Patch Set: Created 3 years, 11 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: net/disk_cache/simple/simple_index.cc
diff --git a/net/disk_cache/simple/simple_index.cc b/net/disk_cache/simple/simple_index.cc
index a654faf37182e5287f715c87cce96efc9bc37045..0991b9566fdae4c5ae3c06b9efe7527f51a7438e 100644
--- a/net/disk_cache/simple/simple_index.cc
+++ b/net/disk_cache/simple/simple_index.cc
@@ -23,6 +23,7 @@
#include "base/task_runner.h"
#include "base/threading/worker_pool.h"
#include "base/time/time.h"
+#include "base/trace_event/memory_usage_estimator.h"
#include "net/base/net_errors.h"
#include "net/disk_cache/simple/simple_entry_format.h"
#include "net/disk_cache/simple/simple_histogram_macros.h"
@@ -139,6 +140,10 @@ bool EntryMetadata::Deserialize(base::PickleIterator* it) {
return true;
}
+size_t EntryMetadata::EstimateMemoryUsage() const {
+ return 0;
+}
+
SimpleIndex::SimpleIndex(
const scoped_refptr<base::SingleThreadTaskRunner>& io_thread,
SimpleIndexDelegate* delegate,
@@ -268,6 +273,10 @@ uint64_t SimpleIndex::GetCacheSizeBetween(base::Time initial_time,
return size;
}
+size_t SimpleIndex::EstimateMemoryUsage() const {
+ return base::trace_event::EstimateMemoryUsage(entries_set_);
ssid 2017/01/31 22:24:19 Do we need a todo here for other objects here, lik
xunjieli 2017/02/01 01:15:52 I added |removed_entries_|. SimpleIndexFile doesn'
+}
+
void SimpleIndex::Insert(uint64_t entry_hash) {
DCHECK(io_thread_checker_.CalledOnValidThread());
// Upon insert we don't know yet the size of the entry.

Powered by Google App Engine
This is Rietveld 408576698