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

Unified Diff: content/browser/tracing/trace_subscriber_stdio.h

Issue 23125009: Add support for writing system traces at startup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review concerns Created 7 years, 4 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/browser/tracing/trace_controller_impl.cc ('k') | content/browser/tracing/trace_subscriber_stdio.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tracing/trace_subscriber_stdio.h
diff --git a/content/browser/tracing/trace_subscriber_stdio.h b/content/browser/tracing/trace_subscriber_stdio.h
index 06a70db8c88be665ec5407aa1f3df7109cfd7bb3..b9fc4f74c199594d525c519671e55920205a1ccf 100644
--- a/content/browser/tracing/trace_subscriber_stdio.h
+++ b/content/browser/tracing/trace_subscriber_stdio.h
@@ -17,14 +17,24 @@ class FilePath;
namespace content {
-class TraceSubscriberStdioImpl;
-
// Stdio implementation of TraceSubscriber. Use this to write traces to a file.
class CONTENT_EXPORT TraceSubscriberStdio
: NON_EXPORTED_BASE(public TraceSubscriber) {
public:
- // Creates or overwrites the specified file. Check IsValid() for success.
- explicit TraceSubscriberStdio(const base::FilePath& path);
+ enum FileType {
+ // Output file as array, representing trace events:
+ // [event1, event2, ...]
+ FILE_TYPE_ARRAY,
+ // Output file as property list with one or two items:
+ // {traceEvents: [event1, event2, ...],
+ // systemTraceEvents: "event1\nevent2\n..." // optional}
+ FILE_TYPE_PROPERTY_LIST
+ };
+
+ // has_system_trace indicates whether system trace events are expected.
+ TraceSubscriberStdio(const base::FilePath& path,
+ FileType file_type,
+ bool has_system_trace);
virtual ~TraceSubscriberStdio();
// Implementation of TraceSubscriber
@@ -32,8 +42,13 @@ class CONTENT_EXPORT TraceSubscriberStdio
virtual void OnTraceDataCollected(
const scoped_refptr<base::RefCountedString>& data_ptr) OVERRIDE;
+ // To be used as callback to DebugDaemonClient::RequestStopSystemTracing().
+ virtual void OnEndSystemTracing(
sky 2013/08/20 15:38:07 Do you need the virtual?
+ const scoped_refptr<base::RefCountedString>& events_str_ptr);
+
private:
- scoped_refptr<TraceSubscriberStdioImpl> impl_;
+ class TraceSubscriberStdioWorker;
+ scoped_refptr<TraceSubscriberStdioWorker> worker_;
DISALLOW_COPY_AND_ASSIGN(TraceSubscriberStdio);
};
« no previous file with comments | « content/browser/tracing/trace_controller_impl.cc ('k') | content/browser/tracing/trace_subscriber_stdio.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698