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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
380 return false; // Not compiled in. | 380 return false; // Not compiled in. |
381 #else | 381 #else |
382 if (!status) { | 382 if (!status) { |
383 base::AutoLock lock(list_lock_); | 383 base::AutoLock lock(list_lock_); |
384 DCHECK(status_ == ACTIVE || status_ == SHUTDOWN); | 384 DCHECK(status_ == ACTIVE || status_ == SHUTDOWN); |
385 status_ = SHUTDOWN; | 385 status_ = SHUTDOWN; |
386 return true; | 386 return true; |
387 } | 387 } |
388 base::AutoLock lock(list_lock_); | 388 base::AutoLock lock(list_lock_); |
389 DCHECK_EQ(UNINITIALIZED, status_); | 389 DCHECK_EQ(UNINITIALIZED, status_); |
390 CHECK(tls_index_.Initialize(NULL)); | 390 DCHECK(tls_index_.Initialize(NULL)); |
jar (doing other things)
2011/10/23 00:36:28
The call to Initialize(...) is for side effects (i
| |
391 status_ = ACTIVE; | 391 status_ = ACTIVE; |
392 return true; | 392 return true; |
393 #endif | 393 #endif |
394 } | 394 } |
395 | 395 |
396 // static | 396 // static |
397 bool ThreadData::IsActive() { | 397 bool ThreadData::IsActive() { |
398 return status_ == ACTIVE; | 398 return status_ == ACTIVE; |
399 } | 399 } |
400 | 400 |
(...skipping 23 matching lines...) Expand all Loading... | |
424 thread_data_list = thread_data_list->next(); | 424 thread_data_list = thread_data_list->next(); |
425 | 425 |
426 for (BirthMap::iterator it = next_thread_data->birth_map_.begin(); | 426 for (BirthMap::iterator it = next_thread_data->birth_map_.begin(); |
427 next_thread_data->birth_map_.end() != it; ++it) | 427 next_thread_data->birth_map_.end() != it; ++it) |
428 delete it->second; // Delete the Birth Records. | 428 delete it->second; // Delete the Birth Records. |
429 next_thread_data->birth_map_.clear(); | 429 next_thread_data->birth_map_.clear(); |
430 next_thread_data->death_map_.clear(); | 430 next_thread_data->death_map_.clear(); |
431 delete next_thread_data; // Includes all Death Records. | 431 delete next_thread_data; // Includes all Death Records. |
432 } | 432 } |
433 | 433 |
434 CHECK(tls_index_.initialized()); | 434 DCHECK(tls_index_.initialized()); |
435 tls_index_.Free(); | 435 tls_index_.Free(); |
436 DCHECK(!tls_index_.initialized()); | 436 DCHECK(!tls_index_.initialized()); |
437 status_ = UNINITIALIZED; | 437 status_ = UNINITIALIZED; |
438 } | 438 } |
439 | 439 |
440 //------------------------------------------------------------------------------ | 440 //------------------------------------------------------------------------------ |
441 // Individual 3-tuple of birth (place and thread) along with death thread, and | 441 // Individual 3-tuple of birth (place and thread) along with death thread, and |
442 // the accumulated stats for instances (DeathData). | 442 // the accumulated stats for instances (DeathData). |
443 | 443 |
444 Snapshot::Snapshot(const BirthOnThread& birth_on_thread, | 444 Snapshot::Snapshot(const BirthOnThread& birth_on_thread, |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
954 (combined_selectors_ & BIRTH_THREAD) ? "*" : | 954 (combined_selectors_ & BIRTH_THREAD) ? "*" : |
955 sample.birth().birth_thread()->thread_name().c_str(), | 955 sample.birth().birth_thread()->thread_name().c_str(), |
956 (combined_selectors_ & DEATH_THREAD) ? "*" : | 956 (combined_selectors_ & DEATH_THREAD) ? "*" : |
957 sample.DeathThreadName().c_str()); | 957 sample.DeathThreadName().c_str()); |
958 sample.birth().location().Write(!(combined_selectors_ & BIRTH_FILE), | 958 sample.birth().location().Write(!(combined_selectors_ & BIRTH_FILE), |
959 !(combined_selectors_ & BIRTH_FUNCTION), | 959 !(combined_selectors_ & BIRTH_FUNCTION), |
960 output); | 960 output); |
961 } | 961 } |
962 | 962 |
963 } // namespace tracked_objects | 963 } // namespace tracked_objects |
OLD | NEW |