Index: net/filter/brotli_source_stream.cc |
diff --git a/net/filter/brotli_source_stream.cc b/net/filter/brotli_source_stream.cc |
index 2ad18c39f156fff5aa56b6fb85767c7673869f97..8870b53259ac7b9b4ac14f7f9d23d161183c03d9 100644 |
--- a/net/filter/brotli_source_stream.cc |
+++ b/net/filter/brotli_source_stream.cc |
@@ -10,6 +10,9 @@ |
#include "base/macros.h" |
#include "base/memory/ptr_util.h" |
#include "base/metrics/histogram_macros.h" |
+#include "base/strings/stringprintf.h" |
+#include "base/trace_event/memory_allocator_dump.h" |
+#include "base/trace_event/process_memory_dump.h" |
#include "net/base/io_buffer.h" |
#include "third_party/brotli/include/brotli/decode.h" |
@@ -75,6 +78,19 @@ class BrotliSourceStream : public FilterSourceStream { |
kBuckets); |
} |
+ void DumpMemoryStatsImpl( |
+ base::trace_event::ProcessMemoryDump* pmd, |
+ const std::string& parent_dump_absolute_name) const override { |
+ // Log pointer address to avoid duplication though in practice there is |
+ // often only one BrotliSourceStream per URLRequest. |
+ base::trace_event::MemoryAllocatorDump* brotli_dump = |
+ pmd->CreateAllocatorDump(base::StringPrintf( |
+ "%s/brotli_%p", parent_dump_absolute_name.c_str(), this)); |
+ brotli_dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
+ used_memory_); |
+ } |
+ |
private: |
// Reported in UMA and must be kept in sync with the histograms.xml file. |
enum class DecodingStatus : int { |