| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/string_util.h" | 9 #include "base/string_util.h" |
| 10 | 10 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // ThreadData maintains the central data for all births and death. | 74 // ThreadData maintains the central data for all births and death. |
| 75 | 75 |
| 76 // static | 76 // static |
| 77 ThreadData* ThreadData::first_ = NULL; | 77 ThreadData* ThreadData::first_ = NULL; |
| 78 // static | 78 // static |
| 79 Lock ThreadData::list_lock_; | 79 Lock ThreadData::list_lock_; |
| 80 | 80 |
| 81 // static | 81 // static |
| 82 ThreadData::Status ThreadData::status_ = ThreadData::UNINITIALIZED; | 82 ThreadData::Status ThreadData::status_ = ThreadData::UNINITIALIZED; |
| 83 | 83 |
| 84 ThreadData::ThreadData() : message_loop_(MessageLoop::current()) {} | 84 ThreadData::ThreadData() : next_(NULL), message_loop_(MessageLoop::current()) {} |
| 85 | 85 |
| 86 // static | 86 // static |
| 87 ThreadData* ThreadData::current() { | 87 ThreadData* ThreadData::current() { |
| 88 if (!tls_index_.initialized()) | 88 if (!tls_index_.initialized()) |
| 89 return NULL; | 89 return NULL; |
| 90 | 90 |
| 91 ThreadData* registry = static_cast<ThreadData*>(tls_index_.Get()); | 91 ThreadData* registry = static_cast<ThreadData*>(tls_index_.Get()); |
| 92 if (!registry) { | 92 if (!registry) { |
| 93 // We have to create a new registry for ThreadData. | 93 // We have to create a new registry for ThreadData. |
| 94 bool too_late_to_create = false; | 94 bool too_late_to_create = false; |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 (combined_selectors_ & BIRTH_THREAD) ? "*" : | 897 (combined_selectors_ & BIRTH_THREAD) ? "*" : |
| 898 sample.birth().birth_thread()->ThreadName().c_str(), | 898 sample.birth().birth_thread()->ThreadName().c_str(), |
| 899 (combined_selectors_ & DEATH_THREAD) ? "*" : | 899 (combined_selectors_ & DEATH_THREAD) ? "*" : |
| 900 sample.DeathThreadName().c_str()); | 900 sample.DeathThreadName().c_str()); |
| 901 sample.birth().location().Write(!(combined_selectors_ & BIRTH_FILE), | 901 sample.birth().location().Write(!(combined_selectors_ & BIRTH_FILE), |
| 902 !(combined_selectors_ & BIRTH_FUNCTION), | 902 !(combined_selectors_ & BIRTH_FUNCTION), |
| 903 output); | 903 output); |
| 904 } | 904 } |
| 905 | 905 |
| 906 } // namespace tracked_objects | 906 } // namespace tracked_objects |
| OLD | NEW |