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

Unified Diff: base/tracked_objects.cc

Issue 7316015: Support Closure in ALL the loops! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed nit and rebased. Created 9 years, 5 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/tracked_objects.h ('k') | content/browser/browser_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/tracked_objects.cc
diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc
index f7fd0c22a62c0519dcacb995ba09d4b66d33443a..21ac0fcaf17e37fcec14fbe05d89b1b743aa1b62 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_;
« no previous file with comments | « base/tracked_objects.h ('k') | content/browser/browser_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698