summaryrefslogtreecommitdiffstats
path: root/base/tracked_objects.cc
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-26 18:25:16 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-26 18:25:16 +0000
commit180c85e3e3691042ab617fd0755dcde6e75d5fbd (patch)
treeb9d4fd7a77f7f54dce4463960326ef7b0cd7a270 /base/tracked_objects.cc
parent324ab8e0d77303333f8ad7de3b54d248587687db (diff)
downloadchromium_src-180c85e3e3691042ab617fd0755dcde6e75d5fbd.zip
chromium_src-180c85e3e3691042ab617fd0755dcde6e75d5fbd.tar.gz
chromium_src-180c85e3e3691042ab617fd0755dcde6e75d5fbd.tar.bz2
Support Closure in ALL the loops!
Add an overload for PostTask into MessageLoopProxy, and WorkerPool. BUG=35223 TEST=unittests. Review URL: http://codereview.chromium.org/7316015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94129 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/tracked_objects.cc')
-rw-r--r--base/tracked_objects.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc
index f7fd0c2..21ac0fc 100644
--- a/base/tracked_objects.cc
+++ b/base/tracked_objects.cc
@@ -277,6 +277,26 @@ void ThreadData::TallyADeath(const Births& lifetimes,
}
// static
+Births* ThreadData::TallyABirthIfActive(const Location& location) {
+ if (IsActive()) {
+ ThreadData* current_thread_data = current();
+ if (current_thread_data) {
+ return current_thread_data->TallyABirth(location);
+ }
+ }
+
+ return NULL;
+}
+
+// static
+void ThreadData::TallyADeathIfActive(const Births* the_birth,
+ const base::TimeDelta& duration) {
+ if (IsActive() && the_birth) {
+ current()->TallyADeath(*the_birth, duration);
+ }
+}
+
+// static
ThreadData* ThreadData::first() {
base::AutoLock lock(list_lock_);
return first_;