| 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 // This header file defines the set of trace_event macros without specifying | 5 // This header file defines the set of trace_event macros without specifying |
| 6 // how the events actually get collected and stored. If you need to expose trace | 6 // how the events actually get collected and stored. If you need to expose trace |
| 7 // events to some other universe, you can copy-and-paste this file as well as | 7 // events to some other universe, you can copy-and-paste this file as well as |
| 8 // trace_event.h, modifying the macros contained there as necessary for the | 8 // trace_event.h, modifying the macros contained there as necessary for the |
| 9 // target platform. The end result is that multiple libraries can funnel events | 9 // target platform. The end result is that multiple libraries can funnel events |
| 10 // through to a shared trace event collector. | 10 // through to a shared trace event collector. |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // Converting a large data type to a string can be costly. To help with this, | 137 // Converting a large data type to a string can be costly. To help with this, |
| 138 // the trace framework provides an interface ConvertableToTraceFormat. If you | 138 // the trace framework provides an interface ConvertableToTraceFormat. If you |
| 139 // inherit from it and implement the AppendAsTraceFormat method the trace | 139 // inherit from it and implement the AppendAsTraceFormat method the trace |
| 140 // framework will call back to your object to convert a trace output time. This | 140 // framework will call back to your object to convert a trace output time. This |
| 141 // means, if the category for the event is disabled, the conversion will not | 141 // means, if the category for the event is disabled, the conversion will not |
| 142 // happen. | 142 // happen. |
| 143 // | 143 // |
| 144 // class MyData : public base::debug::ConvertableToTraceFormat { | 144 // class MyData : public base::debug::ConvertableToTraceFormat { |
| 145 // public: | 145 // public: |
| 146 // MyData() {} | 146 // MyData() {} |
| 147 // virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE { | 147 // virtual void AppendAsTraceFormat(std::string* out) const override { |
| 148 // out->append("{\"foo\":1}"); | 148 // out->append("{\"foo\":1}"); |
| 149 // } | 149 // } |
| 150 // private: | 150 // private: |
| 151 // virtual ~MyData() {} | 151 // virtual ~MyData() {} |
| 152 // DISALLOW_COPY_AND_ASSIGN(MyData); | 152 // DISALLOW_COPY_AND_ASSIGN(MyData); |
| 153 // }; | 153 // }; |
| 154 // | 154 // |
| 155 // TRACE_EVENT1("foo", "bar", "data", | 155 // TRACE_EVENT1("foo", "bar", "data", |
| 156 // scoped_refptr<ConvertableToTraceFormat>(new MyData())); | 156 // scoped_refptr<ConvertableToTraceFormat>(new MyData())); |
| 157 // | 157 // |
| (...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1570 const char* name_; | 1570 const char* name_; |
| 1571 IDType id_; | 1571 IDType id_; |
| 1572 | 1572 |
| 1573 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); | 1573 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); |
| 1574 }; | 1574 }; |
| 1575 | 1575 |
| 1576 } // namespace debug | 1576 } // namespace debug |
| 1577 } // namespace base | 1577 } // namespace base |
| 1578 | 1578 |
| 1579 #endif /* BASE_DEBUG_TRACE_EVENT_H_ */ | 1579 #endif /* BASE_DEBUG_TRACE_EVENT_H_ */ |
| OLD | NEW |