Chromium Code Reviews| Index: base/trace_event/trace_event.h |
| diff --git a/base/trace_event/trace_event.h b/base/trace_event/trace_event.h |
| index 4de64837161fded5fd176d1dc5136006d8521a9e..0b3817a0f1412611df04072dda8f5b4cf4f0a27d 100644 |
| --- a/base/trace_event/trace_event.h |
| +++ b/base/trace_event/trace_event.h |
| @@ -376,29 +376,20 @@ TRACE_EVENT_API_CLASS_EXPORT extern \ |
| } \ |
| } while (0) |
| -// This macro ignores whether the bind_id is local, global, or mangled. |
| -#define INTERNAL_TRACE_EVENT_ADD_BIND_IDS(category_group, name, id, bind_id, \ |
| - ...) \ |
| +// The linked ID will not be mangled. |
| +#define INTERNAL_TRACE_EVENT_ADD_LINK_IDS(category_group, name, id1, id2) \ |
| do { \ |
| INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ |
| if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ |
| - trace_event_internal::TraceID source_id((id)); \ |
| + trace_event_internal::TraceID source_id((id1)); \ |
| unsigned int source_flags = source_id.id_flags(); \ |
| - trace_event_internal::TraceID target_id((bind_id)); \ |
| - if (target_id.scope() == trace_event_internal::kGlobalScope) { \ |
| - trace_event_internal::AddTraceEvent( \ |
| - TRACE_EVENT_PHASE_BIND_IDS, \ |
| - INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ |
| - name, source_id.scope(), source_id.raw_id(), \ |
| - source_flags, target_id.raw_id(), ##__VA_ARGS__); \ |
| - } else { \ |
| - trace_event_internal::AddTraceEvent( \ |
| - TRACE_EVENT_PHASE_BIND_IDS, \ |
| - INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ |
| - name, source_id.scope(), source_id.raw_id(), \ |
| - source_flags, target_id.raw_id(), \ |
| - "bind_scope", target_id.scope(), ##__VA_ARGS__); \ |
| - } \ |
| + trace_event_internal::TraceID target_id((id2)); \ |
| + trace_event_internal::AddTraceEvent( \ |
| + TRACE_EVENT_PHASE_LINK_IDS, \ |
| + INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ |
| + name, source_id.scope(), source_id.raw_id(), source_flags, \ |
| + trace_event_internal::kNoId, \ |
| + "linked_id", target_id.dict_value()); \ |
| } \ |
| } while (0) |
| @@ -582,6 +573,9 @@ class TraceID { |
| const char* scope() const { return scope_; } |
| unsigned int id_flags() const { return id_flags_; } |
| + std::unique_ptr<base::trace_event::ConvertableToTraceFormat> |
| + dict_value() const; |
|
Primiano Tucci (use gerrit)
2016/10/06 16:28:27
lowe_case is only for inline methods.
s/dict_value
chiniforooshan
2016/10/06 20:20:03
Done.
|
| + |
| private: |
| const char* scope_ = nullptr; |
| unsigned long long raw_id_; |
| @@ -1136,6 +1130,8 @@ class TraceEventSamplingStateScope { |
| namespace base { |
| namespace trace_event { |
| +class ConvertableToTraceFormat; |
|
Primiano Tucci (use gerrit)
2016/10/06 16:28:26
shouldn't this fwd declaration be *before* you use
chiniforooshan
2016/10/06 20:20:03
Done.
|
| + |
| template<typename IDType> class TraceScopedTrackableObject { |
| public: |
| TraceScopedTrackableObject(const char* category_group, const char* name, |