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

Unified Diff: base/threading/worker_pool_win.cc

Issue 7778033: Add trace code to track all posted tasks in message_loop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win trace tests Created 9 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
Index: base/threading/worker_pool_win.cc
diff --git a/base/threading/worker_pool_win.cc b/base/threading/worker_pool_win.cc
index 2aa423f035bd46334546a0a138563f5ae6b6b637..a840b57e95039f9f861860f8df0f684d07305b44 100644
--- a/base/threading/worker_pool_win.cc
+++ b/base/threading/worker_pool_win.cc
@@ -5,6 +5,7 @@
#include "base/threading/worker_pool.h"
#include "base/bind.h"
+#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/task.h"
#include "base/tracked_objects.h"
@@ -17,7 +18,8 @@ struct PendingTask {
PendingTask(
const tracked_objects::Location& posted_from,
const base::Closure& task)
- : task(task) {
+ : posted_from(posted_from),
+ task(task) {
#if defined(TRACK_ALL_TASK_OBJECTS)
post_births = tracked_objects::ThreadData::TallyABirthIfActive(posted_from);
time_posted = TimeTicks::Now();
@@ -32,12 +34,18 @@ struct PendingTask {
TimeTicks time_posted;
#endif // defined(TRACK_ALL_TASK_OBJECTS)
+ // The site this PendingTask was posted from.
+ tracked_objects::Location posted_from;
+
// The task to run.
base::Closure task;
};
DWORD CALLBACK WorkItemCallback(void* param) {
PendingTask* pending_task = static_cast<PendingTask*>(param);
+ TRACE_EVENT2("base", "WorkItemCallback",
+ "src_file", pending_task->posted_from.file_line(),
+ "src_func", pending_task->posted_from.function_name().data());
pending_task->task.Run();
#if defined(TRACK_ALL_TASK_OBJECTS)
tracked_objects::ThreadData::TallyADeathIfActive(

Powered by Google App Engine
This is Rietveld 408576698