| 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_ |
| 11 | 11 |
| 12 #include <stddef.h> | 12 #include <stddef.h> |
| 13 #include <windows.h> | 13 #include <windows.h> |
| 14 #include <wmistr.h> | 14 #include <wmistr.h> |
| 15 #include <evntrace.h> | 15 #include <evntrace.h> |
| 16 | 16 |
| 17 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/string_piece.h" | 18 #include "base/string_piece.h" |
| 19 | 19 |
| 20 namespace base { |
| 20 class FilePath; | 21 class FilePath; |
| 22 } |
| 21 | 23 |
| 22 namespace logging_win { | 24 namespace logging_win { |
| 23 | 25 |
| 24 // An interface to classes interested in taking action based on events parsed | 26 // An interface to classes interested in taking action based on events parsed |
| 25 // out of a log file created by the FileLogger. | 27 // out of a log file created by the FileLogger. |
| 26 class LogFileDelegate { | 28 class LogFileDelegate { |
| 27 public: | 29 public: |
| 28 virtual ~LogFileDelegate(); | 30 virtual ~LogFileDelegate(); |
| 29 | 31 |
| 30 // Invoked for event types not currently handled by the parser. | 32 // Invoked for event types not currently handled by the parser. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 const intptr_t* backtrace) = 0; | 64 const intptr_t* backtrace) = 0; |
| 63 | 65 |
| 64 protected: | 66 protected: |
| 65 LogFileDelegate(); | 67 LogFileDelegate(); |
| 66 }; | 68 }; |
| 67 | 69 |
| 68 // Reads |log_file|, invoking appropriate methods on |delegate| as events are | 70 // Reads |log_file|, invoking appropriate methods on |delegate| as events are |
| 69 // parsed. Although it is safe to call this from multiple threads, only one | 71 // parsed. Although it is safe to call this from multiple threads, only one |
| 70 // file may be read at a time; other threads trying to read other log files will | 72 // file may be read at a time; other threads trying to read other log files will |
| 71 // be blocked waiting. | 73 // be blocked waiting. |
| 72 void ReadLogFile(const FilePath& log_file, LogFileDelegate* delegate); | 74 void ReadLogFile(const base::FilePath& log_file, LogFileDelegate* delegate); |
| 73 | 75 |
| 74 } // namespace logging_win | 76 } // namespace logging_win |
| 75 | 77 |
| 76 #endif // CHROME_TEST_LOGGING_WIN_LOG_FILE_READER_H_ | 78 #endif // CHROME_TEST_LOGGING_WIN_LOG_FILE_READER_H_ |
| OLD | NEW |