Index: base/pending_task.cc |
diff --git a/base/pending_task.cc b/base/pending_task.cc |
index 3d7891414c8dc7df431f0c4d8a6bf8dcb26eb9a5..e08b781d0fee4f8b060e193fb5c2074520a965f6 100644 |
--- a/base/pending_task.cc |
+++ b/base/pending_task.cc |
@@ -9,6 +9,7 @@ |
namespace base { |
PendingTask::PendingTask(const tracked_objects::Location& posted_from, |
+ const PendingTask* parent_task, |
const base::Closure& task) |
: base::TrackingInfo(posted_from, TimeTicks()), |
task(task), |
@@ -16,9 +17,15 @@ PendingTask::PendingTask(const tracked_objects::Location& posted_from, |
sequence_num(0), |
nestable(true), |
is_high_res(false) { |
+ task_backtrace[0] = posted_from.program_counter(); |
+ if (parent_task) { |
+ memcpy(&task_backtrace[1], &parent_task->task_backtrace[0], |
+ sizeof(task_backtrace[0]) * ARRAYSIZE_UNSAFE(task_backtrace) - 1); |
+ } |
} |
PendingTask::PendingTask(const tracked_objects::Location& posted_from, |
+ const PendingTask* parent_task, |
const base::Closure& task, |
TimeTicks delayed_run_time, |
bool nestable) |
@@ -28,6 +35,11 @@ PendingTask::PendingTask(const tracked_objects::Location& posted_from, |
sequence_num(0), |
nestable(nestable), |
is_high_res(false) { |
+ task_backtrace[0] = posted_from.program_counter(); |
+ if (parent_task) { |
+ memcpy(&task_backtrace[1], &parent_task->task_backtrace[0], |
+ sizeof(task_backtrace[0]) * ARRAYSIZE_UNSAFE(task_backtrace) - 1); |
+ } |
} |
PendingTask::~PendingTask() { |