Chromium Code Reviews| Index: net/filter/filter_source_stream.h |
| diff --git a/net/filter/filter_source_stream.h b/net/filter/filter_source_stream.h |
| index 3d24bd1a92116f0079702c16436a2ed334753ce0..0e4b424a0b24854e32ae72a82f98b66655ab9235 100644 |
| --- a/net/filter/filter_source_stream.h |
| +++ b/net/filter/filter_source_stream.h |
| @@ -15,6 +15,12 @@ |
| #include "net/base/net_export.h" |
| #include "net/filter/source_stream.h" |
| +namespace base { |
| +namespace trace_event { |
| +class MemoryAllocatorDump; |
| +} |
| +} |
| + |
| namespace net { |
| class DrainableIOBuffer; |
| @@ -38,6 +44,9 @@ class NET_EXPORT_PRIVATE FilterSourceStream : public SourceStream { |
| std::string Description() const override; |
| + void DumpMemoryStats( |
| + base::trace_event::MemoryAllocatorDump* dump) const override; |
| + |
| private: |
| enum State { |
| STATE_NONE, |
| @@ -78,6 +87,13 @@ class NET_EXPORT_PRIVATE FilterSourceStream : public SourceStream { |
| int* consumed_bytes, |
| bool upstream_eof_reached) = 0; |
| + // Subclasses can implement this method to dump memory allocation stats. |
|
eroman
2016/12/01 21:04:37
Can you mention what the default implementation do
|
| + // |dump| is the memory allocator dump of the URLRequestJob. |
| + // Subclasses should override this method instead of DumpMemoryStats |
| + // so the whole chain of FilterSourceStream can be accounted for. |
| + virtual void DumpMemoryStatsImpl( |
| + base::trace_event::MemoryAllocatorDump* dump) const; |
| + |
| // Returns a string representation of the type of this FilterSourceStream. |
| // This is for UMA logging. |
| virtual std::string GetTypeAsString() const = 0; |