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 // A log file reader can read log files produced by Event Tracing for Windows | 5 // A log file reader can read log files produced by Event Tracing for Windows |
6 // (by way of the FileLogger class) that contain events generated from a select | 6 // (by way of the FileLogger class) that contain events generated from a select |
7 // few supported providers; see file_logger_win.h for the list. | 7 // few supported providers; see file_logger_win.h for the list. |
8 | 8 |
9 #ifndef CHROME_TEST_LOGGING_WIN_LOG_FILE_READER_H_ | 9 #ifndef CHROME_TEST_LOGGING_WIN_LOG_FILE_READER_H_ |
10 #define CHROME_TEST_LOGGING_WIN_LOG_FILE_READER_H_ | 10 #define CHROME_TEST_LOGGING_WIN_LOG_FILE_READER_H_ |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 // Invoked for full log messages produced by LogEventProvider. | 48 // Invoked for full log messages produced by LogEventProvider. |
49 virtual void OnLogMessageFull(const EVENT_TRACE* event, | 49 virtual void OnLogMessageFull(const EVENT_TRACE* event, |
50 logging::LogSeverity severity, | 50 logging::LogSeverity severity, |
51 DWORD stack_depth, | 51 DWORD stack_depth, |
52 const intptr_t* backtrace, | 52 const intptr_t* backtrace, |
53 int line, | 53 int line, |
54 const base::StringPiece& file, | 54 const base::StringPiece& file, |
55 const base::StringPiece& message) = 0; | 55 const base::StringPiece& message) = 0; |
56 | 56 |
57 // Invoked for trace events produced by TraceEventETWProvider. | |
58 virtual void OnTraceEvent(const EVENT_TRACE* event, | |
59 const base::StringPiece& name, | |
60 char type, | |
61 intptr_t id, | |
62 const base::StringPiece& extra, | |
63 DWORD stack_depth, | |
64 const intptr_t* backtrace) = 0; | |
65 | |
66 protected: | 57 protected: |
67 LogFileDelegate(); | 58 LogFileDelegate(); |
68 }; | 59 }; |
69 | 60 |
70 // Reads |log_file|, invoking appropriate methods on |delegate| as events are | 61 // Reads |log_file|, invoking appropriate methods on |delegate| as events are |
71 // parsed. Although it is safe to call this from multiple threads, only one | 62 // parsed. Although it is safe to call this from multiple threads, only one |
72 // file may be read at a time; other threads trying to read other log files will | 63 // file may be read at a time; other threads trying to read other log files will |
73 // be blocked waiting. | 64 // be blocked waiting. |
74 void ReadLogFile(const base::FilePath& log_file, LogFileDelegate* delegate); | 65 void ReadLogFile(const base::FilePath& log_file, LogFileDelegate* delegate); |
75 | 66 |
76 } // namespace logging_win | 67 } // namespace logging_win |
77 | 68 |
78 #endif // CHROME_TEST_LOGGING_WIN_LOG_FILE_READER_H_ | 69 #endif // CHROME_TEST_LOGGING_WIN_LOG_FILE_READER_H_ |
OLD | NEW |