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

Side by Side Diff: chrome/test/logging/win/log_file_reader.h

Issue 9584017: New test infrastructure for producing verbose logs in failing tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moved logging_win to logging/win so regular filename_rules work Created 8 years, 9 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
« no previous file with comments | « chrome/test/logging/win/log_file_printer.cc ('k') | chrome/test/logging/win/log_file_reader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
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
7 // few supported providers; see file_logger_win.h for the list.
8
9 #ifndef CHROME_TEST_LOGGING_WIN_LOG_FILE_READER_H_
10 #define CHROME_TEST_LOGGING_WIN_LOG_FILE_READER_H_
11 #pragma once
12
13 #include <stddef.h>
14 #include <windows.h>
15 #include <wmistr.h>
16 #include <evntrace.h>
17
18 #include "base/logging.h"
19 #include "base/string_piece.h"
20
21 class FilePath;
22
23 namespace logging_win {
24
25 // An interface to classes interested in taking action based on events parsed
26 // out of a log file created by the FileLogger.
27 class LogFileDelegate {
28 public:
29 virtual ~LogFileDelegate();
30
31 // Invoked for event types not currently handled by the parser.
32 virtual void OnUnknownEvent(const EVENT_TRACE* event) = 0;
33
34 // Invoked for events of known types that cannot be parsed due to unexpected
35 // data.
36 virtual void OnUnparsableEvent(const EVENT_TRACE* event) = 0;
37
38 // Invoked for the header at the front of all log files.
39 virtual void OnFileHeader(const EVENT_TRACE* event,
40 const TRACE_LOGFILE_HEADER* header) = 0;
41
42 // Invoked for simple log messages produced by LogEventProvider.
43 virtual void OnLogMessage(const EVENT_TRACE* event,
44 logging::LogSeverity severity,
45 const base::StringPiece& message) = 0;
46
47 // Invoked for full log messages produced by LogEventProvider.
48 virtual void OnLogMessageFull(const EVENT_TRACE* event,
49 logging::LogSeverity severity,
50 DWORD stack_depth,
51 const intptr_t* backtrace,
52 int line,
53 const base::StringPiece& file,
54 const base::StringPiece& message) = 0;
55
56 // Invoked for trace events produced by TraceEventETWProvider.
57 virtual void OnTraceEvent(const EVENT_TRACE* event,
58 const base::StringPiece& name,
59 char type,
60 intptr_t id,
61 const base::StringPiece& extra,
62 DWORD stack_depth,
63 const intptr_t* backtrace) = 0;
64
65 protected:
66 LogFileDelegate();
67 };
68
69 // Reads |log_file|, invoking appropriate methods on |delegate| as events are
70 // parsed. Although it is safe to call this from multiple threads, only one
71 // file may be read at a time; other threads trying to read other log files will
72 // be blocked waiting.
73 void ReadLogFile(const FilePath& log_file, LogFileDelegate* delegate);
74
75 } // namespace logging_win
76
77 #endif // CHROME_TEST_LOGGING_WIN_LOG_FILE_READER_H_
OLDNEW
« no previous file with comments | « chrome/test/logging/win/log_file_printer.cc ('k') | chrome/test/logging/win/log_file_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698