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

Unified Diff: base/debug/trace_event.h

Issue 468083004: Use NESTABLE_ASYNC APIs to get NetLog data into Tracing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comments and cleaned up tests Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/net/chrome_net_log.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event.h
diff --git a/base/debug/trace_event.h b/base/debug/trace_event.h
index f9dc1c94d6d65b885772a4b1bf3b16005c58c2e9..f0e96a3ddbe61fa40cb0a73cb1bc53c84614e0b4 100644
--- a/base/debug/trace_event.h
+++ b/base/debug/trace_event.h
@@ -634,6 +634,39 @@
static_cast<int>(base::PlatformThread::CurrentId()), \
timestamp, TRACE_EVENT_FLAG_NONE)
+
+// Records a single NET_LOG_BEGIN event called "name" immediately, with 2
+// associated arguments. If the category is not enabled, then this
+// does nothing.
+// - category and name strings must have application lifetime (statics or
+// literals). They may not include " chars.
+// - |id| is used to match the NET_LOG_BEGIN event with the NET_LOG_END event.
+// Events are considered to match if their category_group, name and id values
+// all match. |id| must either be a pointer or an integer value up to 64 bits.
+// If it's a pointer, the bits will be xored with a hash of the process ID so
+// that the same pointer on two different processes will not collide.
+// NET_LOG_ events are supposed to be used for logging NetLog events only.
+
+#define TRACE_EVENT_NET_LOG_BEGIN(category_group, name, id, arg1_name, \
dsinclair 2014/09/02 20:11:45 Each of these macros should have a 2 on the end fo
xunjieli 2014/09/02 20:26:06 Done.
+ arg1_val, arg2_name, arg2_val) \
+ INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NET_LOG_BEGIN, \
+ category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \
+ arg2_name, arg2_val)
+// Records a single NET_LOG_END event for "name" immediately. If the category
+// is not enabled, then this does nothing.
+#define TRACE_EVENT_NET_LOG_END(category_group, name, id, arg1_name, arg1_val, \
+ arg2_name, arg2_val) \
+ INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NET_LOG_END, \
+ category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \
+ arg2_name, arg2_val)
+// Records a single NET_LOG_INSTANT event for "name" immediately.
+// If the category is not enabled, then this does nothing.
+#define TRACE_EVENT_NET_LOG_INSTANT(category_group, name, id, arg1_name, \
+ arg1_val, arg2_name, arg2_val) \
+ INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NET_LOG_INSTANT, \
+ category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \
+ arg2_name, arg2_val)
+
// Records a single FLOW_BEGIN event called "name" immediately, with 0, 1 or 2
// associated arguments. If the category is not enabled, then this
// does nothing.
@@ -972,6 +1005,9 @@ TRACE_EVENT_API_CLASS_EXPORT extern \
#define TRACE_EVENT_PHASE_CREATE_OBJECT ('N')
#define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O')
#define TRACE_EVENT_PHASE_DELETE_OBJECT ('D')
+#define TRACE_EVENT_PHASE_NET_LOG_BEGIN ('b')
+#define TRACE_EVENT_PHASE_NET_LOG_END ('e')
+#define TRACE_EVENT_PHASE_NET_LOG_INSTANT ('i')
dsinclair 2014/09/02 20:11:45 I recommend against using 'i' here. We used to use
xunjieli 2014/09/02 20:26:06 Acknowledged.
// Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT.
#define TRACE_EVENT_FLAG_NONE (static_cast<unsigned char>(0))
« no previous file with comments | « no previous file | chrome/browser/net/chrome_net_log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698