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 #include "chrome/test/logging/win/log_file_reader.h" | 5 #include "chrome/test/logging/win/log_file_reader.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
8 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
9 #include "base/logging_win.h" | 11 #include "base/logging_win.h" |
| 12 #include "base/macros.h" |
10 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
11 #include "base/win/event_trace_consumer.h" | 14 #include "base/win/event_trace_consumer.h" |
12 #include "chrome/test/logging/win/mof_data_parser.h" | 15 #include "chrome/test/logging/win/mof_data_parser.h" |
13 | 16 |
14 namespace logging_win { | 17 namespace logging_win { |
15 | 18 |
16 namespace { | 19 namespace { |
17 | 20 |
18 // TODO(grt) This reverses a mapping produced by base/logging_win.cc's | 21 // TODO(grt) This reverses a mapping produced by base/logging_win.cc's |
19 // LogEventProvider::LogMessage. LogEventProvider should expose a way to map an | 22 // LogEventProvider::LogMessage. LogEventProvider should expose a way to map an |
20 // event level back to a log severity. | 23 // event level back to a log severity. |
21 logging::LogSeverity EventLevelToSeverity(uint8 level) { | 24 logging::LogSeverity EventLevelToSeverity(uint8_t level) { |
22 switch (level) { | 25 switch (level) { |
23 case TRACE_LEVEL_NONE: | 26 case TRACE_LEVEL_NONE: |
24 NOTREACHED(); | 27 NOTREACHED(); |
25 return logging::LOG_ERROR; | 28 return logging::LOG_ERROR; |
26 case TRACE_LEVEL_FATAL: | 29 case TRACE_LEVEL_FATAL: |
27 return logging::LOG_FATAL; | 30 return logging::LOG_FATAL; |
28 case TRACE_LEVEL_ERROR: | 31 case TRACE_LEVEL_ERROR: |
29 return logging::LOG_ERROR; | 32 return logging::LOG_ERROR; |
30 case TRACE_LEVEL_WARNING: | 33 case TRACE_LEVEL_WARNING: |
31 return logging::LOG_WARNING; | 34 return logging::LOG_WARNING; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 207 |
205 LogFileDelegate::~LogFileDelegate() { | 208 LogFileDelegate::~LogFileDelegate() { |
206 } | 209 } |
207 | 210 |
208 void ReadLogFile(const base::FilePath& log_file, LogFileDelegate* delegate) { | 211 void ReadLogFile(const base::FilePath& log_file, LogFileDelegate* delegate) { |
209 DCHECK(delegate); | 212 DCHECK(delegate); |
210 LogFileReader::ReadFile(log_file, delegate); | 213 LogFileReader::ReadFile(log_file, delegate); |
211 } | 214 } |
212 | 215 |
213 } // namespace logging_win | 216 } // namespace logging_win |
OLD | NEW |