| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/event_trace_provider_win.h" | 5 #include "base/event_trace_provider_win.h" |
| 6 #include <windows.h> | 6 #include <windows.h> |
| 7 #include <cguid.h> | 7 #include <cguid.h> |
| 8 | 8 |
| 9 TRACE_GUID_REGISTRATION EtwTraceProvider::obligatory_guid_registration_ = { | 9 TRACE_GUID_REGISTRATION EtwTraceProvider::obligatory_guid_registration_ = { |
| 10 &GUID_NULL, | 10 &GUID_NULL, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 | 42 |
| 43 ULONG EtwTraceProvider::DisableEvents() { | 43 ULONG EtwTraceProvider::DisableEvents() { |
| 44 // Give subclasses a chance to digest the state change. | 44 // Give subclasses a chance to digest the state change. |
| 45 OnEventsDisabled(); | 45 OnEventsDisabled(); |
| 46 | 46 |
| 47 enable_level_ = 0; | 47 enable_level_ = 0; |
| 48 enable_flags_ = 0; | 48 enable_flags_ = 0; |
| 49 session_handle_ = NULL; | 49 session_handle_ = NULL; |
| 50 | 50 |
| 51 PostEventsDisabled(); |
| 52 |
| 51 return ERROR_SUCCESS; | 53 return ERROR_SUCCESS; |
| 52 } | 54 } |
| 53 | 55 |
| 54 ULONG EtwTraceProvider::Callback(WMIDPREQUESTCODE request, void* buffer) { | 56 ULONG EtwTraceProvider::Callback(WMIDPREQUESTCODE request, void* buffer) { |
| 55 switch (request) { | 57 switch (request) { |
| 56 case WMI_ENABLE_EVENTS: | 58 case WMI_ENABLE_EVENTS: |
| 57 return EnableEvents(buffer); | 59 return EnableEvents(buffer); |
| 58 case WMI_DISABLE_EVENTS: | 60 case WMI_DISABLE_EVENTS: |
| 59 return DisableEvents(); | 61 return DisableEvents(); |
| 60 default: | 62 default: |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 119 |
| 118 return ::TraceEvent(session_handle_, &event.header); | 120 return ::TraceEvent(session_handle_, &event.header); |
| 119 } | 121 } |
| 120 | 122 |
| 121 ULONG EtwTraceProvider::Log(EVENT_TRACE_HEADER* event) { | 123 ULONG EtwTraceProvider::Log(EVENT_TRACE_HEADER* event) { |
| 122 if (enable_level_ < event->Class.Level) | 124 if (enable_level_ < event->Class.Level) |
| 123 return ERROR_SUCCESS; | 125 return ERROR_SUCCESS; |
| 124 | 126 |
| 125 return ::TraceEvent(session_handle_, event); | 127 return ::TraceEvent(session_handle_, event); |
| 126 } | 128 } |
| OLD | NEW |