OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <stdlib.h> | 8 #include <stdlib.h> |
9 | 9 |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 if (!current_thread_data) | 545 if (!current_thread_data) |
546 return; | 546 return; |
547 | 547 |
548 int32 queue_duration = 0; | 548 int32 queue_duration = 0; |
549 int32 run_duration = 0; | 549 int32 run_duration = 0; |
550 if (!start_of_run.is_null() && !end_of_run.is_null()) | 550 if (!start_of_run.is_null() && !end_of_run.is_null()) |
551 run_duration = (end_of_run - start_of_run).InMilliseconds(); | 551 run_duration = (end_of_run - start_of_run).InMilliseconds(); |
552 current_thread_data->TallyADeath(*birth, queue_duration, run_duration); | 552 current_thread_data->TallyADeath(*birth, queue_duration, run_duration); |
553 } | 553 } |
554 | 554 |
555 const std::string ThreadData::thread_name() const { return thread_name_; } | |
556 | |
557 // static | 555 // static |
558 void ThreadData::SnapshotAllExecutedTasks(bool reset_max, | 556 void ThreadData::SnapshotAllExecutedTasks(bool reset_max, |
559 ProcessDataSnapshot* process_data, | 557 ProcessDataSnapshot* process_data, |
560 BirthCountMap* birth_counts) { | 558 BirthCountMap* birth_counts) { |
561 if (!kTrackAllTaskObjects) | 559 if (!kTrackAllTaskObjects) |
562 return; // Not compiled in. | 560 return; // Not compiled in. |
563 | 561 |
564 // Get an unchanging copy of a ThreadData list. | 562 // Get an unchanging copy of a ThreadData list. |
565 ThreadData* my_list = ThreadData::first(); | 563 ThreadData* my_list = ThreadData::first(); |
566 | 564 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 : process_id(base::GetCurrentProcId()) { | 863 : process_id(base::GetCurrentProcId()) { |
866 #else | 864 #else |
867 : process_id(0) { | 865 : process_id(0) { |
868 #endif | 866 #endif |
869 } | 867 } |
870 | 868 |
871 ProcessDataSnapshot::~ProcessDataSnapshot() { | 869 ProcessDataSnapshot::~ProcessDataSnapshot() { |
872 } | 870 } |
873 | 871 |
874 } // namespace tracked_objects | 872 } // namespace tracked_objects |
OLD | NEW |