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

Unified Diff: content/public/browser/tracing_controller.h

Issue 1088673003: CompressedStringDataSink for trace_controller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win compile and tests. Created 5 years, 8 months 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 | « content/content_browser.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/tracing_controller.h
diff --git a/content/public/browser/tracing_controller.h b/content/public/browser/tracing_controller.h
index 0cbed7018d64edb5e6a0c9e3b8f40cf5179fc723..37ac2f75551b9cab659d1955b3495d6b9fe3ce02 100644
--- a/content/public/browser/tracing_controller.h
+++ b/content/public/browser/tracing_controller.h
@@ -45,11 +45,29 @@ class TracingController {
virtual ~TraceDataSink() {}
};
+ // An implementation of this interface is passed when constructing a
+ // TraceDataSink, and receives chunks of the final trace data as it's being
+ // constructed.
+ // Methods may be called from any thread.
+ class CONTENT_EXPORT TraceDataEndpoint
+ : public base::RefCountedThreadSafe<TraceDataEndpoint> {
+ public:
+ virtual void ReceiveTraceChunk(const std::string& chunk) {}
+ virtual void ReceiveTraceFinalContents(const std::string& contents) {}
+
+ protected:
+ friend class base::RefCountedThreadSafe<TraceDataEndpoint>;
+ virtual ~TraceDataEndpoint() {}
+ };
+
// Create a trace sink that may be supplied to DisableRecording or
// CaptureMonitoringSnapshot to capture the trace data as a string.
CONTENT_EXPORT static scoped_refptr<TraceDataSink> CreateStringSink(
const base::Callback<void(base::RefCountedString*)>& callback);
+ CONTENT_EXPORT static scoped_refptr<TraceDataSink> CreateCompressedStringSink(
+ scoped_refptr<TraceDataEndpoint> endpoint);
+
// Create a trace sink that may be supplied to DisableRecording or
// CaptureMonitoringSnapshot to dump the trace data to a file.
CONTENT_EXPORT static scoped_refptr<TraceDataSink> CreateFileSink(
« no previous file with comments | « content/content_browser.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698