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

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: trace_event.h formatting fix 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
« no previous file with comments | « base/threading/worker_pool_posix.cc ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b7eaad1b46fea6594c00c723224fdfaaefccfdb8 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);
+ UNSHIPPED_TRACE_EVENT2("task", "WorkItemCallback::Run",
+ "src_file", pending_task->posted_from.file_name(),
+ "src_func", pending_task->posted_from.function_name());
pending_task->task.Run();
#if defined(TRACK_ALL_TASK_OBJECTS)
tracked_objects::ThreadData::TallyADeathIfActive(
« no previous file with comments | « base/threading/worker_pool_posix.cc ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698