| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/tracked_objects.h" | 5 #include "base/tracked_objects.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 status_ = status ? ACTIVE : DEACTIVATED; | 611 status_ = status ? ACTIVE : DEACTIVATED; |
| 612 return true; | 612 return true; |
| 613 } | 613 } |
| 614 | 614 |
| 615 // static | 615 // static |
| 616 bool ThreadData::tracking_status() { | 616 bool ThreadData::tracking_status() { |
| 617 return status_ == ACTIVE; | 617 return status_ == ACTIVE; |
| 618 } | 618 } |
| 619 | 619 |
| 620 // static | 620 // static |
| 621 TrackedTime ThreadData::NowForStartOfRun() { |
| 622 return Now(); |
| 623 } |
| 624 |
| 625 // static |
| 626 TrackedTime ThreadData::NowForEndOfRun() { |
| 627 return Now(); |
| 628 } |
| 629 |
| 630 // static |
| 621 TrackedTime ThreadData::Now() { | 631 TrackedTime ThreadData::Now() { |
| 622 if (kTrackAllTaskObjects && tracking_status()) | 632 if (kTrackAllTaskObjects && tracking_status()) |
| 623 return TrackedTime::Now(); | 633 return TrackedTime::Now(); |
| 624 return TrackedTime(); // Super fast when disabled, or not compiled. | 634 return TrackedTime(); // Super fast when disabled, or not compiled. |
| 625 } | 635 } |
| 626 | 636 |
| 627 // static | 637 // static |
| 628 void ThreadData::ShutdownSingleThreadedCleanup(bool leak) { | 638 void ThreadData::ShutdownSingleThreadedCleanup(bool leak) { |
| 629 // This is only called from test code, where we need to cleanup so that | 639 // This is only called from test code, where we need to cleanup so that |
| 630 // additional tests can be run. | 640 // additional tests can be run. |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1247 (combined_selectors_ & BIRTH_THREAD) ? "*" : | 1257 (combined_selectors_ & BIRTH_THREAD) ? "*" : |
| 1248 sample.birth().birth_thread()->thread_name().c_str(), | 1258 sample.birth().birth_thread()->thread_name().c_str(), |
| 1249 (combined_selectors_ & DEATH_THREAD) ? "*" : | 1259 (combined_selectors_ & DEATH_THREAD) ? "*" : |
| 1250 sample.DeathThreadName().c_str()); | 1260 sample.DeathThreadName().c_str()); |
| 1251 sample.birth().location().Write(!(combined_selectors_ & BIRTH_FILE), | 1261 sample.birth().location().Write(!(combined_selectors_ & BIRTH_FILE), |
| 1252 !(combined_selectors_ & BIRTH_FUNCTION), | 1262 !(combined_selectors_ & BIRTH_FUNCTION), |
| 1253 output); | 1263 output); |
| 1254 } | 1264 } |
| 1255 | 1265 |
| 1256 } // namespace tracked_objects | 1266 } // namespace tracked_objects |
| OLD | NEW |