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

Unified Diff: net/filter/sdch_source_stream.cc

Issue 2525743002: Make URLRequestContext a MemoryDumpProvider (Abandoned) (Closed)
Patch Set: self review 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
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..6b865448c5450bda351f3fda4710376a2ca34f59 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,18 @@ std::string SdchSourceStream::GetTypeAsString() const {
return kSdchPossible;
}
+void SdchSourceStream::DumpMemoryStatsImpl(
+ base::trace_event::MemoryAllocatorDump* dump) const {
+ // Log pointer address to avoid duplication though in practice there is
+ // often only one SdchSourceStream per URLRequest.
+ base::trace_event::MemoryAllocatorDump* sdch_dump =
+ dump->process_memory_dump()->CreateAllocatorDump(base::StringPrintf(
+ "%s/sdch_%p", 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,

Powered by Google App Engine
This is Rietveld 408576698