| 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 // Declaration of a Windows event trace consumer base class. | 5 // Declaration of a Windows event trace consumer base class. |
| 6 #ifndef BASE_EVENT_TRACE_CONSUMER_WIN_H_ | 6 #ifndef BASE_WIN_EVENT_TRACE_CONSUMER_H_ |
| 7 #define BASE_EVENT_TRACE_CONSUMER_WIN_H_ | 7 #define BASE_WIN_EVENT_TRACE_CONSUMER_H_ |
| 8 #pragma once | 8 #pragma once |
| 9 | 9 |
| 10 #include <windows.h> | 10 #include <windows.h> |
| 11 #include <wmistr.h> | 11 #include <wmistr.h> |
| 12 #include <evntrace.h> | 12 #include <evntrace.h> |
| 13 #include <vector> | 13 #include <vector> |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 | 15 |
| 16 namespace base { |
| 17 namespace win { |
| 18 |
| 16 // This class is a base class that makes it easier to consume events | 19 // This class is a base class that makes it easier to consume events |
| 17 // from realtime or file sessions. Concrete consumers need to sublass | 20 // from realtime or file sessions. Concrete consumers need to sublass |
| 18 // a specialization of this class and override the ProcessEvent and/or | 21 // a specialization of this class and override the ProcessEvent and/or |
| 19 // the ProcessBuffer methods to implement the event consumption logic. | 22 // the ProcessBuffer methods to implement the event consumption logic. |
| 20 // Usage might look like: | 23 // Usage might look like: |
| 21 // class MyConsumer: public EtwTraceConsumerBase<MyConsumer, 1> { | 24 // class MyConsumer: public EtwTraceConsumerBase<MyConsumer, 1> { |
| 22 // protected: | 25 // protected: |
| 23 // static VOID WINAPI ProcessEvent(PEVENT_TRACE event); | 26 // static VOID WINAPI ProcessEvent(PEVENT_TRACE event); |
| 24 // }; | 27 // }; |
| 25 // | 28 // |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 if (FAILED(HRESULT_FROM_WIN32(ret))) | 137 if (FAILED(HRESULT_FROM_WIN32(ret))) |
| 135 hr = HRESULT_FROM_WIN32(ret); | 138 hr = HRESULT_FROM_WIN32(ret); |
| 136 } | 139 } |
| 137 | 140 |
| 138 trace_handles_.clear(); | 141 trace_handles_.clear(); |
| 139 } | 142 } |
| 140 | 143 |
| 141 return hr; | 144 return hr; |
| 142 } | 145 } |
| 143 | 146 |
| 144 #endif // BASE_EVENT_TRACE_CONSUMER_WIN_H_ | 147 } // namespace win |
| 148 } // namespace base |
| 149 |
| 150 #endif // BASE_WIN_EVENT_TRACE_CONSUMER_H_ |
| OLD | NEW |