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

Side by Side 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: Wait for complete system tracing implementation 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_TRACING_TRACE_SUBSCRIBER_STDIO_H_ 5 #ifndef CONTENT_BROWSER_TRACING_TRACE_SUBSCRIBER_STDIO_H_
6 #define CONTENT_BROWSER_TRACING_TRACE_SUBSCRIBER_STDIO_H_ 6 #define CONTENT_BROWSER_TRACING_TRACE_SUBSCRIBER_STDIO_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "content/public/browser/trace_subscriber.h" 11 #include "content/public/browser/trace_subscriber.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 13
14 namespace base { 14 namespace base {
15 class FilePath; 15 class FilePath;
16 } 16 }
17 17
18 namespace content { 18 namespace content {
19 19
20 class TraceSubscriberStdioImpl;
21
22 // Stdio implementation of TraceSubscriber. Use this to write traces to a file. 20 // Stdio implementation of TraceSubscriber. Use this to write traces to a file.
23 class CONTENT_EXPORT TraceSubscriberStdio 21 class CONTENT_EXPORT TraceSubscriberStdio
24 : NON_EXPORTED_BASE(public TraceSubscriber) { 22 : NON_EXPORTED_BASE(public TraceSubscriber) {
25 public: 23 public:
26 // Creates or overwrites the specified file. Check IsValid() for success. 24 enum FileType {
sky 2013/08/20 14:28:44 Please add a description of what these mean.
DaveMoore 2013/08/20 14:58:00 Done.
27 explicit TraceSubscriberStdio(const base::FilePath& path); 25 FILE_TYPE_ARRAY,
26 FILE_TYPE_PROPERTY_LIST
27 };
28
29 TraceSubscriberStdio(const base::FilePath& path,
30 FileType file_type,
31 bool has_system_trace);
sky 2013/08/20 14:28:44 Add a description for has_system_trace.
DaveMoore 2013/08/20 14:58:00 Done.
28 virtual ~TraceSubscriberStdio(); 32 virtual ~TraceSubscriberStdio();
29 33
30 // Implementation of TraceSubscriber 34 // Implementation of TraceSubscriber
31 virtual void OnEndTracingComplete() OVERRIDE; 35 virtual void OnEndTracingComplete() OVERRIDE;
32 virtual void OnTraceDataCollected( 36 virtual void OnTraceDataCollected(
33 const scoped_refptr<base::RefCountedString>& data_ptr) OVERRIDE; 37 const scoped_refptr<base::RefCountedString>& data_ptr) OVERRIDE;
34 38
39 virtual void OnEndSystemTracing(
sky 2013/08/20 14:36:09 One more. Is this part of TraceSubscriber? If so,
DaveMoore 2013/08/20 14:58:00 Done.
40 const scoped_refptr<base::RefCountedString>& events_str_ptr);
sky 2013/08/20 14:36:09 nit: two more spaces here.
DaveMoore 2013/08/20 14:58:00 Done.
41
35 private: 42 private:
36 scoped_refptr<TraceSubscriberStdioImpl> impl_; 43 class TraceSubscriberStdioWorker;
44 scoped_refptr<TraceSubscriberStdioWorker> worker_;
37 DISALLOW_COPY_AND_ASSIGN(TraceSubscriberStdio); 45 DISALLOW_COPY_AND_ASSIGN(TraceSubscriberStdio);
38 }; 46 };
39 47
40 } // namespace content 48 } // namespace content
41 49
42 #endif // CONTENT_BROWSER_TRACING_TRACE_SUBSCRIBER_STDIO_H_ 50 #endif // CONTENT_BROWSER_TRACING_TRACE_SUBSCRIBER_STDIO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698