Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(434)

Side by Side Diff: base/tracked_objects.cc

Issue 11293086: base: Constantify thread_name() getter accessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/tracked_objects.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « base/tracked_objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698