diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-24 17:57:46 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-24 17:57:46 +0000 |
commit | b29700d01f9ca042807edbf68bb671be2c3936e4 (patch) | |
tree | 52c204c57571476ef2575fb6536c19cacdc15fc2 /base/task.h | |
parent | bddd0bd549af2d1d2e39d719b946a98a9b2dea68 (diff) | |
download | chromium_src-b29700d01f9ca042807edbf68bb671be2c3936e4.zip chromium_src-b29700d01f9ca042807edbf68bb671be2c3936e4.tar.gz chromium_src-b29700d01f9ca042807edbf68bb671be2c3936e4.tar.bz2 |
Store information about invoked RunnableFunction on stack to aid debugging of canary channel crashes.
TEST=compiles
BUG=81449
Review URL: http://codereview.chromium.org/7066006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86447 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/task.h')
-rw-r--r-- | base/task.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/base/task.h b/base/task.h index 643e418..b698576 100644 --- a/base/task.h +++ b/base/task.h @@ -7,11 +7,16 @@ #pragma once #include "base/base_api.h" +#include "base/debug/alias.h" #include "base/memory/raw_scoped_refptr_mismatch_checker.h" #include "base/memory/weak_ptr.h" #include "base/tracked.h" #include "base/tuple.h" +namespace base { +const size_t kDeadTask = 0xDEAD7A53; +} + // Task ------------------------------------------------------------------------ // // A task is a generic runnable thingy, usually used for running code on a @@ -325,6 +330,7 @@ class RunnableMethod : public CancelableTask { ~RunnableMethod() { ReleaseCallee(); + obj_ = reinterpret_cast<T*>(base::kDeadTask); } virtual void Run() { @@ -452,9 +458,18 @@ class RunnableFunction : public Task { } ~RunnableFunction() { + function_ = reinterpret_cast<Function>(base::kDeadTask); } virtual void Run() { + // TODO(apatrick): Remove this ASAP. This ensures that the function pointer + // is available in minidumps for the purpose of diagnosing + // http://crbug.com/81449. + Function function = function_; + base::debug::Alias(&function); + Params params = params_; + base::debug::Alias(¶ms); + if (function_) DispatchToFunction(function_, params_); } |