diff options
author | jar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-01 21:55:17 +0000 |
---|---|---|
committer | jar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-01 21:55:17 +0000 |
commit | ee73678e5a629620179e30dbea0db263d07c38a1 (patch) | |
tree | 180bf57d36bdb33c6ce4f724f750e9d4064ceaa8 /base/tracked.h | |
parent | 1f9431546f1bafcbe8d5e0127ab8861413487174 (diff) | |
download | chromium_src-ee73678e5a629620179e30dbea0db263d07c38a1.zip chromium_src-ee73678e5a629620179e30dbea0db263d07c38a1.tar.gz chromium_src-ee73678e5a629620179e30dbea0db263d07c38a1.tar.bz2 |
A new (private) interface is supplied that allows the object watcher (coding in
proress by Darin) to Post the task (when the object is signaled) into a message
loop.
I also cleaned up the time-of-birth for tasks that sleep for a while before
running (such as those held by the timer, or by passed to this new
PostSignaledTask() interface.
r=darin
M base/tracked.cc
M base/message_loop.h
M base/message_loop.cc
M base/tracked.h
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/tracked.h')
-rw-r--r-- | base/tracked.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/base/tracked.h b/base/tracked.h index ea4092f..5ef5c29 100644 --- a/base/tracked.h +++ b/base/tracked.h @@ -48,8 +48,10 @@ #include "base/time.h" #ifndef NDEBUG +#ifndef TRACK_ALL_TASK_OBJECTS #define TRACK_ALL_TASK_OBJECTS -#endif +#endif // TRACK_ALL_TASK_OBJECTS +#endif // NDEBUG namespace tracked_objects { @@ -119,13 +121,25 @@ class Tracked { public: Tracked(); virtual ~Tracked(); + + // Used to record the FROM_HERE location of a caller. void SetBirthPlace(const Location& from_here); + // When a task sits around a long time, such as in a timer, or object watcher, + // this method should be called when the task becomes active, and its + // significant lifetime begins (and its waiting to be woken up has passed). + void ResetBirthTime(); + bool MissingBirthplace() const; private: - Births* tracked_births_; // At same birthplace, and same thread. - const Time tracked_birth_time_; + // Pointer to instance were counts of objects with the same birth location + // (on the same thread) are stored. + Births* tracked_births_; + // The time this object was constructed. If its life consisted of a long + // waiting period, and then it became active, then this value is generally + // reset before the object begins it active life. + Time tracked_birth_time_; DISALLOW_EVIL_CONSTRUCTORS(Tracked); }; |