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

Unified Diff: net/filter/sdch_source_stream.cc

Issue 2540233002: Instrument SourceStream using MemoryDumpProvider
Patch Set: Rebased Created 4 years 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 | « net/filter/sdch_source_stream.h ('k') | net/filter/source_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/filter/sdch_source_stream.cc
diff --git a/net/filter/sdch_source_stream.cc b/net/filter/sdch_source_stream.cc
index c54620e961f6d8162b34f441be8a0e1f0c37e01f..d67773c23bb6f3f9071a0b7f769823a2b74f0702 100644
--- a/net/filter/sdch_source_stream.cc
+++ b/net/filter/sdch_source_stream.cc
@@ -8,6 +8,9 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
+#include "base/strings/stringprintf.h"
+#include "base/trace_event/memory_allocator_dump.h"
+#include "base/trace_event/process_memory_dump.h"
#include "base/values.h"
#include "net/base/io_buffer.h"
#include "net/log/net_log_capture_mode.h"
@@ -54,6 +57,19 @@ std::string SdchSourceStream::GetTypeAsString() const {
return kSdchPossible;
}
+void SdchSourceStream::DumpMemoryStatsImpl(
+ base::trace_event::ProcessMemoryDump* pmd,
+ const std::string& parent_dump_absolute_name) const {
+ // Log pointer address to avoid duplication though in practice there is
+ // often only one SdchSourceStream per URLRequest.
+ base::trace_event::MemoryAllocatorDump* sdch_dump =
+ pmd->CreateAllocatorDump(base::StringPrintf(
+ "%s/sdch_%p", parent_dump_absolute_name.c_str(), this));
+ sdch_dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ buffered_output_.size());
+}
+
int SdchSourceStream::FilterData(IOBuffer* output_buffer,
int output_buffer_size,
IOBuffer* input_buffer,
« no previous file with comments | « net/filter/sdch_source_stream.h ('k') | net/filter/source_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698