| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 FROM_HERE, new RunTheStatic(function, completion_handle, counter)); | 445 FROM_HERE, new RunTheStatic(function, completion_handle, counter)); |
| 446 | 446 |
| 447 // Also run Task on our thread. | 447 // Also run Task on our thread. |
| 448 RunTheStatic local_task(function, completion_handle, counter); | 448 RunTheStatic local_task(function, completion_handle, counter); |
| 449 local_task.Run(); | 449 local_task.Run(); |
| 450 | 450 |
| 451 WaitForSingleObject(completion_handle, INFINITE); | 451 WaitForSingleObject(completion_handle, INFINITE); |
| 452 int ret_val = CloseHandle(completion_handle); | 452 int ret_val = CloseHandle(completion_handle); |
| 453 DCHECK(ret_val); | 453 DCHECK(ret_val); |
| 454 } | 454 } |
| 455 #endif | 455 #endif // OS_WIN |
| 456 | 456 |
| 457 // static | 457 // static |
| 458 bool ThreadData::StartTracking(bool status) { | 458 bool ThreadData::StartTracking(bool status) { |
| 459 #ifndef TRACK_ALL_TASK_OBJECTS | 459 #ifndef TRACK_ALL_TASK_OBJECTS |
| 460 return false; // Not compiled in. | 460 return false; // Not compiled in. |
| 461 #endif | 461 #endif |
| 462 | 462 |
| 463 if (!status) { | 463 if (!status) { |
| 464 base::AutoLock lock(list_lock_); | 464 base::AutoLock lock(list_lock_); |
| 465 DCHECK(status_ == ACTIVE || status_ == SHUTDOWN); | 465 DCHECK(status_ == ACTIVE || status_ == SHUTDOWN); |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1048 (combined_selectors_ & BIRTH_THREAD) ? "*" : | 1048 (combined_selectors_ & BIRTH_THREAD) ? "*" : |
| 1049 sample.birth().birth_thread()->ThreadName().c_str(), | 1049 sample.birth().birth_thread()->ThreadName().c_str(), |
| 1050 (combined_selectors_ & DEATH_THREAD) ? "*" : | 1050 (combined_selectors_ & DEATH_THREAD) ? "*" : |
| 1051 sample.DeathThreadName().c_str()); | 1051 sample.DeathThreadName().c_str()); |
| 1052 sample.birth().location().Write(!(combined_selectors_ & BIRTH_FILE), | 1052 sample.birth().location().Write(!(combined_selectors_ & BIRTH_FILE), |
| 1053 !(combined_selectors_ & BIRTH_FUNCTION), | 1053 !(combined_selectors_ & BIRTH_FUNCTION), |
| 1054 output); | 1054 output); |
| 1055 } | 1055 } |
| 1056 | 1056 |
| 1057 } // namespace tracked_objects | 1057 } // namespace tracked_objects |
| OLD | NEW |