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

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

Issue 2374193002: Make base::PendingTask support ConvertableToTraceFormat (Closed)
Patch Set: JsonWriter::Write requires a temp var Created 4 years, 2 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
« base/pending_task.cc ('K') | « base/pending_task.cc ('k') | no next file » | 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 #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_event_common.h instead of here. 10 // implementation-specific should go in trace_event_common.h instead of here.
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 /* Local class friendly DISALLOW_COPY_AND_ASSIGN */ \ 431 /* Local class friendly DISALLOW_COPY_AND_ASSIGN */ \
432 INTERNAL_TRACE_EVENT_UID(ScopedContext) \ 432 INTERNAL_TRACE_EVENT_UID(ScopedContext) \
433 (const INTERNAL_TRACE_EVENT_UID(ScopedContext)&) {}; \ 433 (const INTERNAL_TRACE_EVENT_UID(ScopedContext)&) {}; \
434 void operator=(const INTERNAL_TRACE_EVENT_UID(ScopedContext)&) {}; \ 434 void operator=(const INTERNAL_TRACE_EVENT_UID(ScopedContext)&) {}; \
435 }; \ 435 }; \
436 INTERNAL_TRACE_EVENT_UID(ScopedContext) \ 436 INTERNAL_TRACE_EVENT_UID(ScopedContext) \
437 INTERNAL_TRACE_EVENT_UID(scoped_context)(context); 437 INTERNAL_TRACE_EVENT_UID(scoped_context)(context);
438 438
439 // Implementation detail: internal macro to trace a task execution with the 439 // Implementation detail: internal macro to trace a task execution with the
440 // location where it was posted from. 440 // location where it was posted from.
441 #define INTERNAL_TRACE_TASK_EXECUTION(run_function, task) \ 441 #define INTERNAL_TRACE_TASK_EXECUTION(run_function, task) \
Sami 2016/10/04 11:25:31 I believe there are a number of tools (e.g., Light
442 TRACE_EVENT2("toplevel", run_function, "src_file", \ 442 TRACE_EVENT1("toplevel", run_function, "src_info", (task).GetTracingInfo()); \
443 (task).posted_from.file_name(), "src_func", \ 443 TRACE_HEAP_PROFILER_API_SCOPED_TASK_EXECUTION INTERNAL_TRACE_EVENT_UID( \
444 (task).posted_from.function_name()); \
445 TRACE_HEAP_PROFILER_API_SCOPED_TASK_EXECUTION INTERNAL_TRACE_EVENT_UID( \
446 task_event)((task).posted_from.file_name()); 444 task_event)((task).posted_from.file_name());
447 445
448 namespace trace_event_internal { 446 namespace trace_event_internal {
449 447
450 // Specify these values when the corresponding argument of AddTraceEvent is not 448 // Specify these values when the corresponding argument of AddTraceEvent is not
451 // used. 449 // used.
452 const int kZeroNumArgs = 0; 450 const int kZeroNumArgs = 0;
453 const std::nullptr_t kGlobalScope = nullptr; 451 const std::nullptr_t kGlobalScope = nullptr;
454 const unsigned long long kNoId = 0; 452 const unsigned long long kNoId = 0;
455 453
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 const char* name_; 1157 const char* name_;
1160 IDType id_; 1158 IDType id_;
1161 1159
1162 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); 1160 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject);
1163 }; 1161 };
1164 1162
1165 } // namespace trace_event 1163 } // namespace trace_event
1166 } // namespace base 1164 } // namespace base
1167 1165
1168 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ 1166 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_
OLDNEW
« base/pending_task.cc ('K') | « base/pending_task.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698