Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: base/debug/trace_event.h

Issue 14244010: Correctly handle multiple convertable argument names. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/debug/trace_event_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 const char* name, 1053 const char* name,
1054 unsigned long long id, 1054 unsigned long long id,
1055 int thread_id, 1055 int thread_id,
1056 const base::TimeTicks& timestamp, 1056 const base::TimeTicks& timestamp,
1057 unsigned char flags, 1057 unsigned char flags,
1058 const char* arg1_name, 1058 const char* arg1_name,
1059 scoped_ptr<base::debug::ConvertableToTraceFormat> arg1_val, 1059 scoped_ptr<base::debug::ConvertableToTraceFormat> arg1_val,
1060 const char* arg2_name, 1060 const char* arg2_name,
1061 scoped_ptr<base::debug::ConvertableToTraceFormat> arg2_val) { 1061 scoped_ptr<base::debug::ConvertableToTraceFormat> arg2_val) {
1062 const int num_args = 2; 1062 const int num_args = 2;
1063 const char* arg_names[2] = { arg1_name, arg2_name };
1063 unsigned char arg_types[2] = 1064 unsigned char arg_types[2] =
1064 { TRACE_VALUE_TYPE_CONVERTABLE, TRACE_VALUE_TYPE_CONVERTABLE }; 1065 { TRACE_VALUE_TYPE_CONVERTABLE, TRACE_VALUE_TYPE_CONVERTABLE };
1065 scoped_ptr<base::debug::ConvertableToTraceFormat> convertable_values[2]; 1066 scoped_ptr<base::debug::ConvertableToTraceFormat> convertable_values[2];
1066 convertable_values[0].reset(arg1_val.release()); 1067 convertable_values[0].reset(arg1_val.release());
1067 convertable_values[1].reset(arg2_val.release()); 1068 convertable_values[1].reset(arg2_val.release());
1068 1069
1069 TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( 1070 TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP(
1070 phase, category_group_enabled, name, id, thread_id, timestamp, 1071 phase, category_group_enabled, name, id, thread_id, timestamp,
1071 num_args, &arg1_name, arg_types, NULL, convertable_values, flags); 1072 num_args, arg_names, arg_types, NULL, convertable_values, flags);
1072 } 1073 }
1073 1074
1074 static inline void AddTraceEvent( 1075 static inline void AddTraceEvent(
1075 char phase, 1076 char phase,
1076 const unsigned char* category_group_enabled, 1077 const unsigned char* category_group_enabled,
1077 const char* name, 1078 const char* name,
1078 unsigned long long id, 1079 unsigned long long id,
1079 unsigned char flags, 1080 unsigned char flags,
1080 const char* arg1_name, 1081 const char* arg1_name,
1081 scoped_ptr<base::debug::ConvertableToTraceFormat> arg1_val, 1082 scoped_ptr<base::debug::ConvertableToTraceFormat> arg1_val,
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 const char* name_; 1284 const char* name_;
1284 IDType id_; 1285 IDType id_;
1285 1286
1286 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); 1287 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject);
1287 }; 1288 };
1288 1289
1289 } // namespace debug 1290 } // namespace debug
1290 } // namespace base 1291 } // namespace base
1291 1292
1292 #endif /* BASE_DEBUG_TRACE_EVENT_H_ */ 1293 #endif /* BASE_DEBUG_TRACE_EVENT_H_ */
OLDNEW
« no previous file with comments | « no previous file | base/debug/trace_event_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698