OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_TRACE_SUBSCRIBER_STDIO_H_ |
| 6 #define CONTENT_BROWSER_TRACE_SUBSCRIBER_STDIO_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <string> |
| 10 |
| 11 #include "base/file_util.h" |
| 12 #include "content/browser/trace_controller.h" |
| 13 |
| 14 // Stdio implementation of TraceSubscriber. Use this to write traces to a file. |
| 15 class TraceSubscriberStdio : public TraceSubscriber { |
| 16 public: |
| 17 // Creates or overwrites the specified file. Check IsValid() for success. |
| 18 explicit TraceSubscriberStdio(const FilePath& path); |
| 19 |
| 20 // Returns TRUE if we're currently writing data to a file. |
| 21 bool IsValid(); |
| 22 |
| 23 // Implementation of TraceSubscriber |
| 24 virtual void OnEndTracingComplete(); |
| 25 virtual void OnTraceDataCollected(const std::string& json_events); |
| 26 |
| 27 virtual ~TraceSubscriberStdio(); |
| 28 |
| 29 private: |
| 30 FILE* m_file; |
| 31 }; |
| 32 |
| 33 #endif // CONTENT_BROWSER_TRACE_SUBSCRIBER_STDIO_H_ |
OLD | NEW |