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