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

Unified Diff: net/filter/filter_source_stream.h

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/brotli_source_stream.cc ('k') | net/filter/filter_source_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9ea2b3f76c9d290e773992d04eac73ceec269bd3 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 ProcessMemoryDump;
+}
+}
+
namespace net {
class DrainableIOBuffer;
@@ -38,6 +44,10 @@ class NET_EXPORT_PRIVATE FilterSourceStream : public SourceStream {
std::string Description() const override;
+ void DumpMemoryStats(
+ base::trace_event::ProcessMemoryDump* dump,
+ const std::string& parent_dump_absolute_name) const override;
+
private:
enum State {
STATE_NONE,
@@ -78,6 +88,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.
+ // Subclasses should override this method instead of DumpMemoryStats
+ // so the whole chain of FilterSourceStream can be accounted for.
+ virtual void DumpMemoryStatsImpl(
+ base::trace_event::ProcessMemoryDump* dump,
+ const std::string& parent_dump_absolute_name) const;
+
// Returns a string representation of the type of this FilterSourceStream.
// This is for UMA logging.
virtual std::string GetTypeAsString() const = 0;
« no previous file with comments | « net/filter/brotli_source_stream.cc ('k') | net/filter/filter_source_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698