OLD | NEW |
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_TRACE_SUBSCRIBER_STDIO_H_ | 5 #ifndef CONTENT_BROWSER_TRACE_SUBSCRIBER_STDIO_H_ |
6 #define CONTENT_BROWSER_TRACE_SUBSCRIBER_STDIO_H_ | 6 #define CONTENT_BROWSER_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 "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "content/public/browser/trace_subscriber.h" | 12 #include "content/public/browser/trace_subscriber.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | 16 |
17 class TraceSubscriberStdioImpl; | 17 class TraceSubscriberStdioImpl; |
18 | 18 |
19 // Stdio implementation of TraceSubscriber. Use this to write traces to a file. | 19 // Stdio implementation of TraceSubscriber. Use this to write traces to a file. |
20 class CONTENT_EXPORT TraceSubscriberStdio | 20 class CONTENT_EXPORT TraceSubscriberStdio |
21 : NON_EXPORTED_BASE(public content::TraceSubscriber) { | 21 : NON_EXPORTED_BASE(public TraceSubscriber) { |
22 public: | 22 public: |
23 // Creates or overwrites the specified file. Check IsValid() for success. | 23 // Creates or overwrites the specified file. Check IsValid() for success. |
24 explicit TraceSubscriberStdio(const FilePath& path); | 24 explicit TraceSubscriberStdio(const FilePath& path); |
25 virtual ~TraceSubscriberStdio(); | 25 virtual ~TraceSubscriberStdio(); |
26 | 26 |
27 // Implementation of TraceSubscriber | 27 // Implementation of TraceSubscriber |
28 virtual void OnEndTracingComplete() OVERRIDE; | 28 virtual void OnEndTracingComplete() OVERRIDE; |
29 virtual void OnTraceDataCollected( | 29 virtual void OnTraceDataCollected( |
30 const scoped_refptr<base::RefCountedString>& data_ptr) OVERRIDE; | 30 const scoped_refptr<base::RefCountedString>& data_ptr) OVERRIDE; |
31 | 31 |
32 private: | 32 private: |
33 scoped_refptr<TraceSubscriberStdioImpl> impl_; | 33 scoped_refptr<TraceSubscriberStdioImpl> impl_; |
34 DISALLOW_COPY_AND_ASSIGN(TraceSubscriberStdio); | 34 DISALLOW_COPY_AND_ASSIGN(TraceSubscriberStdio); |
35 }; | 35 }; |
36 | 36 |
37 } // namespace content | 37 } // namespace content |
38 | 38 |
39 #endif // CONTENT_BROWSER_TRACE_SUBSCRIBER_STDIO_H_ | 39 #endif // CONTENT_BROWSER_TRACE_SUBSCRIBER_STDIO_H_ |
OLD | NEW |