| 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/file_logger.h" | 5 #include "chrome/test/logging/win/file_logger.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <guiddef.h> | 8 #include <guiddef.h> |
| 9 #include <objbase.h> | 9 #include <objbase.h> |
| 10 | 10 |
| 11 #include <ios> | 11 #include <ios> |
| 12 | 12 |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/logging_win.h" | 15 #include "base/logging_win.h" |
| 16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 18 #include "base/trace_event/trace_event_win.h" | |
| 19 #include "base/win/event_trace_consumer.h" | 18 #include "base/win/event_trace_consumer.h" |
| 20 #include "base/win/registry.h" | 19 #include "base/win/registry.h" |
| 21 | 20 |
| 22 namespace logging_win { | 21 namespace logging_win { |
| 23 | 22 |
| 24 namespace { | 23 namespace { |
| 25 | 24 |
| 26 const wchar_t kChromeTestSession[] = L"chrome_tests"; | 25 const wchar_t kChromeTestSession[] = L"chrome_tests"; |
| 27 | 26 |
| 28 // From chrome_tab.cc: {0562BFC3-2550-45b4-BD8E-A310583D3A6F} | 27 // From chrome_tab.cc: {0562BFC3-2550-45b4-BD8E-A310583D3A6F} |
| (...skipping 14 matching lines...) Expand all Loading... |
| 43 // The configurations for the supported providers. This must be in sync with | 42 // The configurations for the supported providers. This must be in sync with |
| 44 // FileLogger::EventProviderBits. | 43 // FileLogger::EventProviderBits. |
| 45 const struct { | 44 const struct { |
| 46 const GUID* provider_name; | 45 const GUID* provider_name; |
| 47 uint8 level; | 46 uint8 level; |
| 48 uint32 flags; | 47 uint32 flags; |
| 49 } kProviders[] = { | 48 } kProviders[] = { |
| 50 { &kChromeTraceProviderName, 255, 0 }, | 49 { &kChromeTraceProviderName, 255, 0 }, |
| 51 { &kChromeFrameProvider, 255, 0 }, | 50 { &kChromeFrameProvider, 255, 0 }, |
| 52 { &kChromeTestsProvider, 255, 0 }, | 51 { &kChromeTestsProvider, 255, 0 }, |
| 53 { &base::trace_event::kChromeTraceProviderName, 255, 0 } | |
| 54 }; | 52 }; |
| 55 | 53 |
| 56 static_assert((1 << arraysize(kProviders)) - 1 == | 54 static_assert((1 << arraysize(kProviders)) - 1 == |
| 57 FileLogger::kAllEventProviders, | 55 FileLogger::kAllEventProviders, |
| 58 "size of kProviders is inconsistent with kAllEventProviders"); | 56 "size of kProviders is inconsistent with kAllEventProviders"); |
| 59 | 57 |
| 60 } // namespace | 58 } // namespace |
| 61 | 59 |
| 62 bool FileLogger::is_initialized_ = false; | 60 bool FileLogger::is_initialized_ = false; |
| 63 | 61 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 176 |
| 179 hr = controller_.Flush(NULL); | 177 hr = controller_.Flush(NULL); |
| 180 LOG_IF(ERROR, FAILED(hr)) | 178 LOG_IF(ERROR, FAILED(hr)) |
| 181 << "Failed to flush events; hr=" << std::hex << hr; | 179 << "Failed to flush events; hr=" << std::hex << hr; |
| 182 hr = controller_.Stop(NULL); | 180 hr = controller_.Stop(NULL); |
| 183 LOG_IF(ERROR, FAILED(hr)) | 181 LOG_IF(ERROR, FAILED(hr)) |
| 184 << "Failed to stop ETW session; hr=" << std::hex << hr; | 182 << "Failed to stop ETW session; hr=" << std::hex << hr; |
| 185 } | 183 } |
| 186 | 184 |
| 187 } // namespace logging_win | 185 } // namespace logging_win |
| OLD | NEW |