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 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_H_ | 5 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_H_ |
6 #define BASE_TRACE_EVENT_TRACE_EVENT_H_ | 6 #define BASE_TRACE_EVENT_TRACE_EVENT_H_ |
7 | 7 |
8 // This header file defines implementation details of how the trace macros in | 8 // This header file defines implementation details of how the trace macros in |
9 // trace_event_common.h collect and store trace events. Anything not | 9 // trace_event_common.h collect and store trace events. Anything not |
10 // implementation-specific should go in trace_macros_common.h instead of here. | 10 // implementation-specific should go in trace_macros_common.h instead of here. |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 template<typename IDType> class TraceScopedTrackableObject { | 964 template<typename IDType> class TraceScopedTrackableObject { |
965 public: | 965 public: |
966 TraceScopedTrackableObject(const char* category_group, const char* name, | 966 TraceScopedTrackableObject(const char* category_group, const char* name, |
967 IDType id) | 967 IDType id) |
968 : category_group_(category_group), | 968 : category_group_(category_group), |
969 name_(name), | 969 name_(name), |
970 id_(id) { | 970 id_(id) { |
971 TRACE_EVENT_OBJECT_CREATED_WITH_ID(category_group_, name_, id_); | 971 TRACE_EVENT_OBJECT_CREATED_WITH_ID(category_group_, name_, id_); |
972 } | 972 } |
973 | 973 |
974 template <typename ArgType> void snapshot(ArgType snapshot) { | 974 template <typename ArgType> |
| 975 void Snapshot(ArgType snapshot) const { |
975 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(category_group_, name_, id_, snapshot); | 976 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(category_group_, name_, id_, snapshot); |
976 } | 977 } |
977 | 978 |
978 ~TraceScopedTrackableObject() { | 979 ~TraceScopedTrackableObject() { |
979 TRACE_EVENT_OBJECT_DELETED_WITH_ID(category_group_, name_, id_); | 980 TRACE_EVENT_OBJECT_DELETED_WITH_ID(category_group_, name_, id_); |
980 } | 981 } |
981 | 982 |
982 private: | 983 private: |
983 const char* category_group_; | 984 const char* category_group_; |
984 const char* name_; | 985 const char* name_; |
985 IDType id_; | 986 IDType id_; |
986 | 987 |
987 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); | 988 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); |
988 }; | 989 }; |
989 | 990 |
| 991 using TraceID = trace_event_internal::TraceID; |
| 992 |
990 } // namespace trace_event | 993 } // namespace trace_event |
991 } // namespace base | 994 } // namespace base |
992 | 995 |
993 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ | 996 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ |
OLD | NEW |