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

Side by Side Diff: base/tracked_objects.cc

Issue 9702014: [UMA] Use proper C++ objects to serialize tracked_objects across process boundaries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix up unit tests Created 8 years, 8 months 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
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"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/process_util.h"
11 #include "base/profiler/alternate_timer.h" 13 #include "base/profiler/alternate_timer.h"
12 #include "base/stringprintf.h" 14 #include "base/stringprintf.h"
13 #include "base/third_party/valgrind/memcheck.h" 15 #include "base/third_party/valgrind/memcheck.h"
14 #include "base/threading/thread_restrictions.h" 16 #include "base/threading/thread_restrictions.h"
15 #include "build/build_config.h"
16 #include "base/port.h" 17 #include "base/port.h"
17 18
18 using base::TimeDelta; 19 using base::TimeDelta;
19 20
20 namespace tracked_objects { 21 namespace tracked_objects {
21 22
22 namespace { 23 namespace {
23 24
24 // Flag to compile out almost all of the task tracking code. 25 // Flag to compile out almost all of the task tracking code.
25 const bool kTrackAllTaskObjects = true; 26 const bool kTrackAllTaskObjects = true;
26 27
27 // Flag to compile out parent-child link recording. 28 // Flag to compile out parent-child link recording.
28 const bool kTrackParentChildLinks = false; 29 const bool kTrackParentChildLinks = true;
jar (doing other things) 2012/04/09 23:32:59 I haven't checked to see if this has a perf implic
Ilya Sherman 2012/04/10 00:37:42 Done. Definitely didn't mean to include this in t
29 30
30 // When ThreadData is first initialized, should we start in an ACTIVE state to 31 // When ThreadData is first initialized, should we start in an ACTIVE state to
31 // record all of the startup-time tasks, or should we start up DEACTIVATED, so 32 // record all of the startup-time tasks, or should we start up DEACTIVATED, so
32 // that we only record after parsing the command line flag --enable-tracking. 33 // that we only record after parsing the command line flag --enable-tracking.
33 // Note that the flag may force either state, so this really controls only the 34 // Note that the flag may force either state, so this really controls only the
34 // period of time up until that flag is parsed. If there is no flag seen, then 35 // period of time up until that flag is parsed. If there is no flag seen, then
35 // this state may prevail for much or all of the process lifetime. 36 // this state may prevail for much or all of the process lifetime.
36 const ThreadData::Status kInitialStartupState = 37 const ThreadData::Status kInitialStartupState =
37 ThreadData::PROFILING_CHILDREN_ACTIVE; 38 ThreadData::PROFILING_CHILDREN_ACTIVE;
38 39
39 // Control whether an alternate time source (Now() function) is supported by 40 // Control whether an alternate time source (Now() function) is supported by
40 // the ThreadData class. This compile time flag should be set to true if we 41 // the ThreadData class. This compile time flag should be set to true if we
41 // want other modules (such as a memory allocator, or a thread-specific CPU time 42 // want other modules (such as a memory allocator, or a thread-specific CPU time
42 // clock) to be able to provide a thread-specific Now() function. Without this 43 // clock) to be able to provide a thread-specific Now() function. Without this
43 // compile-time flag, the code will only support the wall-clock time. This flag 44 // compile-time flag, the code will only support the wall-clock time. This flag
44 // can be flipped to efficiently disable this path (if there is a performance 45 // can be flipped to efficiently disable this path (if there is a performance
45 // problem with its presence). 46 // problem with its presence).
46 static const bool kAllowAlternateTimeSourceHandling = true; 47 static const bool kAllowAlternateTimeSourceHandling = true;
48
47 } // namespace 49 } // namespace
48 50
49 //------------------------------------------------------------------------------ 51 //------------------------------------------------------------------------------
50 // DeathData tallies durations when a death takes place. 52 // DeathData tallies durations when a death takes place.
51 53
52 DeathData::DeathData() { 54 DeathData::DeathData() {
53 Clear(); 55 Clear();
54 } 56 }
55 57
56 DeathData::DeathData(int count) { 58 DeathData::DeathData(int count) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 108 }
107 109
108 int32 DeathData::queue_duration_max() const { 110 int32 DeathData::queue_duration_max() const {
109 return queue_duration_max_; 111 return queue_duration_max_;
110 } 112 }
111 113
112 int32 DeathData::queue_duration_sample() const { 114 int32 DeathData::queue_duration_sample() const {
113 return queue_duration_sample_; 115 return queue_duration_sample_;
114 } 116 }
115 117
116
117 base::DictionaryValue* DeathData::ToValue() const {
118 base::DictionaryValue* dictionary = new base::DictionaryValue;
119 dictionary->Set("count", base::Value::CreateIntegerValue(count_));
120 dictionary->Set("run_ms",
121 base::Value::CreateIntegerValue(run_duration_sum()));
122 dictionary->Set("run_ms_max",
123 base::Value::CreateIntegerValue(run_duration_max()));
124 dictionary->Set("run_ms_sample",
125 base::Value::CreateIntegerValue(run_duration_sample()));
126 dictionary->Set("queue_ms",
127 base::Value::CreateIntegerValue(queue_duration_sum()));
128 dictionary->Set("queue_ms_max",
129 base::Value::CreateIntegerValue(queue_duration_max()));
130 dictionary->Set("queue_ms_sample",
131 base::Value::CreateIntegerValue(queue_duration_sample()));
132 return dictionary;
133 }
134
135 void DeathData::ResetMax() { 118 void DeathData::ResetMax() {
136 run_duration_max_ = 0; 119 run_duration_max_ = 0;
137 queue_duration_max_ = 0; 120 queue_duration_max_ = 0;
138 } 121 }
139 122
140 void DeathData::Clear() { 123 void DeathData::Clear() {
141 count_ = 0; 124 count_ = 0;
142 run_duration_sum_ = 0; 125 run_duration_sum_ = 0;
143 run_duration_max_ = 0; 126 run_duration_max_ = 0;
144 run_duration_sample_ = 0; 127 run_duration_sample_ = 0;
145 queue_duration_sum_ = 0; 128 queue_duration_sum_ = 0;
146 queue_duration_max_ = 0; 129 queue_duration_max_ = 0;
147 queue_duration_sample_ = 0; 130 queue_duration_sample_ = 0;
148 } 131 }
149 132
150 //------------------------------------------------------------------------------ 133 //------------------------------------------------------------------------------
134 DeathDataSnapshot::DeathDataSnapshot()
135 : count(-1),
136 run_duration_sum(-1),
137 run_duration_max(-1),
138 run_duration_sample(-1),
139 queue_duration_sum(-1),
140 queue_duration_max(-1),
141 queue_duration_sample(-1) {
142 }
143
144 DeathDataSnapshot::DeathDataSnapshot(
145 const tracked_objects::DeathData& death_data)
146 : count(death_data.count()),
147 run_duration_sum(death_data.run_duration_sum()),
148 run_duration_max(death_data.run_duration_max()),
149 run_duration_sample(death_data.run_duration_sample()),
150 queue_duration_sum(death_data.queue_duration_sum()),
151 queue_duration_max(death_data.queue_duration_max()),
152 queue_duration_sample(death_data.queue_duration_sample()) {
153 }
154
155 DeathDataSnapshot::~DeathDataSnapshot() {
156 }
157
158 //------------------------------------------------------------------------------
151 BirthOnThread::BirthOnThread(const Location& location, 159 BirthOnThread::BirthOnThread(const Location& location,
152 const ThreadData& current) 160 const ThreadData& current)
153 : location_(location), 161 : location_(location),
154 birth_thread_(&current) { 162 birth_thread_(&current) {
155 } 163 }
156 164
157 const Location BirthOnThread::location() const { return location_; } 165 //------------------------------------------------------------------------------
158 const ThreadData* BirthOnThread::birth_thread() const { return birth_thread_; } 166 BirthOnThreadSnapshot::BirthOnThreadSnapshot() {
167 }
159 168
160 void BirthOnThread::ToValue(const std::string& prefix, 169 BirthOnThreadSnapshot::BirthOnThreadSnapshot(
161 base::DictionaryValue* dictionary) const { 170 const tracked_objects::BirthOnThread& birth)
162 dictionary->Set(prefix + "_location", location_.ToValue()); 171 : location(birth.location()),
163 dictionary->Set(prefix + "_thread", 172 thread_name(birth.birth_thread()->thread_name()) {
164 base::Value::CreateStringValue(birth_thread_->thread_name())); 173 }
174
175 BirthOnThreadSnapshot::~BirthOnThreadSnapshot() {
165 } 176 }
166 177
167 //------------------------------------------------------------------------------ 178 //------------------------------------------------------------------------------
168 Births::Births(const Location& location, const ThreadData& current) 179 Births::Births(const Location& location, const ThreadData& current)
169 : BirthOnThread(location, current), 180 : BirthOnThread(location, current),
170 birth_count_(1) { } 181 birth_count_(1) { }
171 182
172 int Births::birth_count() const { return birth_count_; } 183 int Births::birth_count() const { return birth_count_; }
173 184
174 void Births::RecordBirth() { ++birth_count_; } 185 void Births::RecordBirth() { ++birth_count_; }
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 return; 338 return;
328 } 339 }
329 // We must NOT do any allocations during this callback. 340 // We must NOT do any allocations during this callback.
330 // Using the simple linked lists avoids all allocations. 341 // Using the simple linked lists avoids all allocations.
331 DCHECK_EQ(this->next_retired_worker_, reinterpret_cast<ThreadData*>(NULL)); 342 DCHECK_EQ(this->next_retired_worker_, reinterpret_cast<ThreadData*>(NULL));
332 this->next_retired_worker_ = first_retired_worker_; 343 this->next_retired_worker_ = first_retired_worker_;
333 first_retired_worker_ = this; 344 first_retired_worker_ = this;
334 } 345 }
335 346
336 // static 347 // static
337 base::DictionaryValue* ThreadData::ToValue(bool reset_max) { 348 void ThreadData::Snapshot(bool reset_max, ProcessDataSnapshot* process_data) {
338 DataCollector collected_data; // Gather data. 349 // Add births that have run to completion to |collected_data|.
339 // Request multiple calls to collected_data.Append() for all threads. 350 // |birth_counts| tracks the total number of births recorded at each location
340 SendAllMaps(reset_max, &collected_data); 351 // for which we have not seen a death count.
341 collected_data.AddListOfLivingObjects(); // Add births that are still alive. 352 std::map<const BirthOnThread*, int> birth_counts;
342 base::DictionaryValue* dictionary = new base::DictionaryValue(); 353 ThreadData::SnapshotAllExecutedTasks(reset_max, process_data, &birth_counts);
343 collected_data.ToValue(dictionary); 354
344 return dictionary; 355 // Add births that are still active -- i.e. objects that have tallied a birth,
356 // but have not yet tallied a matching death, and hence must be either
357 // running, queued up, or being held in limbo for future posting.
358 for (std::map<const BirthOnThread*, int>::const_iterator it =
359 birth_counts.begin();
360 it != birth_counts.end(); ++it) {
361 if (it->second > 0) {
362 process_data->tasks.push_back(
363 TaskSnapshot(*it->first, DeathData(it->second), "Still_Alive"));
364 }
365 }
345 } 366 }
346 367
347 Births* ThreadData::TallyABirth(const Location& location) { 368 Births* ThreadData::TallyABirth(const Location& location) {
348 BirthMap::iterator it = birth_map_.find(location); 369 BirthMap::iterator it = birth_map_.find(location);
349 Births* child; 370 Births* child;
350 if (it != birth_map_.end()) { 371 if (it != birth_map_.end()) {
351 child = it->second; 372 child = it->second;
352 child->RecordBirth(); 373 child->RecordBirth();
353 } else { 374 } else {
354 child = new Births(location, *this); // Leak this. 375 child = new Births(location, *this); // Leak this.
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 541
521 int32 queue_duration = 0; 542 int32 queue_duration = 0;
522 int32 run_duration = 0; 543 int32 run_duration = 0;
523 if (!start_of_run.is_null() && !end_of_run.is_null()) 544 if (!start_of_run.is_null() && !end_of_run.is_null())
524 run_duration = (end_of_run - start_of_run).InMilliseconds(); 545 run_duration = (end_of_run - start_of_run).InMilliseconds();
525 current_thread_data->TallyADeath(*birth, queue_duration, run_duration); 546 current_thread_data->TallyADeath(*birth, queue_duration, run_duration);
526 } 547 }
527 548
528 const std::string ThreadData::thread_name() const { return thread_name_; } 549 const std::string ThreadData::thread_name() const { return thread_name_; }
529 550
551 // static
552 void ThreadData::SnapshotAllExecutedTasks(
553 bool reset_max,
554 ProcessDataSnapshot* process_data,
555 std::map<const BirthOnThread*, int>* birth_counts) {
556 if (!kTrackAllTaskObjects)
557 return; // Not compiled in.
558
559 // Get an unchanging copy of a ThreadData list.
560 ThreadData* my_list = ThreadData::first();
561
562 // Gather data serially.
563 // This hackish approach *can* get some slighly corrupt tallies, as we are
564 // grabbing values without the protection of a lock, but it has the advantage
565 // of working even with threads that don't have message loops. If a user
566 // sees any strangeness, they can always just run their stats gathering a
567 // second time.
568 for (ThreadData* thread_data = my_list;
569 thread_data;
570 thread_data = thread_data->next()) {
571 thread_data->SnapshotExecutedTasks(reset_max, process_data, birth_counts);
572 }
573 }
574
575 void ThreadData::SnapshotExecutedTasks(
576 bool reset_max,
577 ProcessDataSnapshot* process_data,
578 std::map<const BirthOnThread*, int>* birth_counts) {
579 // Get copy of data, so that the data will not change during the iterations
580 // and processing.
581 ThreadData::BirthMap birth_map;
582 ThreadData::DeathMap death_map;
583 ThreadData::ParentChildSet parent_child_set;
584 SnapshotMaps(reset_max, &birth_map, &death_map, &parent_child_set);
585
586 for (ThreadData::DeathMap::const_iterator it = death_map.begin();
587 it != death_map.end(); ++it) {
588 process_data->tasks.push_back(
589 TaskSnapshot(*it->first, it->second, thread_name()));
590 (*birth_counts)[it->first] -= it->first->birth_count();
591 }
592
593 for (ThreadData::BirthMap::const_iterator it = birth_map.begin();
594 it != birth_map.end(); ++it) {
595 (*birth_counts)[it->second] += it->second->birth_count();
596 }
597
598 if (!kTrackParentChildLinks)
599 return;
600
601 for (ThreadData::ParentChildSet::const_iterator it = parent_child_set.begin();
602 it != parent_child_set.end(); ++it) {
603 process_data->descendants.push_back(ParentChildPairSnapshot(*it));
604 }
605 }
606
530 // This may be called from another thread. 607 // This may be called from another thread.
531 void ThreadData::SnapshotMaps(bool reset_max, 608 void ThreadData::SnapshotMaps(bool reset_max,
532 BirthMap* birth_map, 609 BirthMap* birth_map,
533 DeathMap* death_map, 610 DeathMap* death_map,
534 ParentChildSet* parent_child_set) { 611 ParentChildSet* parent_child_set) {
535 base::AutoLock lock(map_lock_); 612 base::AutoLock lock(map_lock_);
536 for (BirthMap::const_iterator it = birth_map_.begin(); 613 for (BirthMap::const_iterator it = birth_map_.begin();
537 it != birth_map_.end(); ++it) 614 it != birth_map_.end(); ++it)
538 (*birth_map)[it->first] = it->second; 615 (*birth_map)[it->first] = it->second;
539 for (DeathMap::iterator it = death_map_.begin(); 616 for (DeathMap::iterator it = death_map_.begin();
540 it != death_map_.end(); ++it) { 617 it != death_map_.end(); ++it) {
541 (*death_map)[it->first] = it->second; 618 (*death_map)[it->first] = it->second;
542 if (reset_max) 619 if (reset_max)
543 it->second.ResetMax(); 620 it->second.ResetMax();
544 } 621 }
545 622
546 if (!kTrackParentChildLinks) 623 if (!kTrackParentChildLinks)
547 return; 624 return;
548 625
549 for (ParentChildSet::iterator it = parent_child_set_.begin(); 626 for (ParentChildSet::iterator it = parent_child_set_.begin();
550 it != parent_child_set_.end(); ++it) 627 it != parent_child_set_.end(); ++it)
551 parent_child_set->insert(*it); 628 parent_child_set->insert(*it);
552 } 629 }
553 630
554 // static 631 // static
555 void ThreadData::SendAllMaps(bool reset_max, class DataCollector* target) {
556 if (!kTrackAllTaskObjects)
557 return; // Not compiled in.
558 // Get an unchanging copy of a ThreadData list.
559 ThreadData* my_list = ThreadData::first();
560
561 // Gather data serially.
562 // This hackish approach *can* get some slighly corrupt tallies, as we are
563 // grabbing values without the protection of a lock, but it has the advantage
564 // of working even with threads that don't have message loops. If a user
565 // sees any strangeness, they can always just run their stats gathering a
566 // second time.
567 for (ThreadData* thread_data = my_list;
568 thread_data;
569 thread_data = thread_data->next()) {
570 // Get copy of data.
571 ThreadData::BirthMap birth_map;
572 ThreadData::DeathMap death_map;
573 ThreadData::ParentChildSet parent_child_set;
574 thread_data->SnapshotMaps(reset_max, &birth_map, &death_map,
575 &parent_child_set);
576 target->Append(*thread_data, birth_map, death_map, parent_child_set);
577 }
578 }
579
580 // static
581 void ThreadData::ResetAllThreadData() { 632 void ThreadData::ResetAllThreadData() {
582 ThreadData* my_list = first(); 633 ThreadData* my_list = first();
583 634
584 for (ThreadData* thread_data = my_list; 635 for (ThreadData* thread_data = my_list;
585 thread_data; 636 thread_data;
586 thread_data = thread_data->next()) 637 thread_data = thread_data->next())
587 thread_data->Reset(); 638 thread_data->Reset();
588 } 639 }
589 640
590 void ThreadData::Reset() { 641 void ThreadData::Reset() {
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 thread_data_list = thread_data_list->next(); 829 thread_data_list = thread_data_list->next();
779 830
780 for (BirthMap::iterator it = next_thread_data->birth_map_.begin(); 831 for (BirthMap::iterator it = next_thread_data->birth_map_.begin();
781 next_thread_data->birth_map_.end() != it; ++it) 832 next_thread_data->birth_map_.end() != it; ++it)
782 delete it->second; // Delete the Birth Records. 833 delete it->second; // Delete the Birth Records.
783 delete next_thread_data; // Includes all Death Records. 834 delete next_thread_data; // Includes all Death Records.
784 } 835 }
785 } 836 }
786 837
787 //------------------------------------------------------------------------------ 838 //------------------------------------------------------------------------------
788 // Individual 3-tuple of birth (place and thread) along with death thread, and 839 TaskSnapshot::TaskSnapshot() {
789 // the accumulated stats for instances (DeathData).
790
791 Snapshot::Snapshot(const BirthOnThread& birth_on_thread,
792 const ThreadData& death_thread,
793 const DeathData& death_data)
794 : birth_(&birth_on_thread),
795 death_thread_(&death_thread),
796 death_data_(death_data) {
797 } 840 }
798 841
799 Snapshot::Snapshot(const BirthOnThread& birth_on_thread, int count) 842 TaskSnapshot::TaskSnapshot(const BirthOnThread& birth,
800 : birth_(&birth_on_thread), 843 const DeathData& death_data,
801 death_thread_(NULL), 844 const std::string& death_thread_name)
802 death_data_(DeathData(count)) { 845 : birth(birth),
846 death_data(death_data),
847 death_thread_name(death_thread_name) {
803 } 848 }
804 849
805 const std::string Snapshot::DeathThreadName() const { 850 TaskSnapshot::~TaskSnapshot() {
806 if (death_thread_)
807 return death_thread_->thread_name();
808 return "Still_Alive";
809 }
810
811 base::DictionaryValue* Snapshot::ToValue() const {
812 base::DictionaryValue* dictionary = new base::DictionaryValue;
813 // TODO(jar): Switch the next two lines to:
814 // birth_->ToValue("birth", dictionary);
815 // ...but that will require fixing unit tests, and JS to take
816 // "birth_location" rather than "location"
817 dictionary->Set("birth_thread",
818 base::Value::CreateStringValue(birth_->birth_thread()->thread_name()));
819 dictionary->Set("location", birth_->location().ToValue());
820
821 dictionary->Set("death_data", death_data_.ToValue());
822 dictionary->Set("death_thread",
823 base::Value::CreateStringValue(DeathThreadName()));
824 return dictionary;
825 } 851 }
826 852
827 //------------------------------------------------------------------------------ 853 //------------------------------------------------------------------------------
828 // DataCollector 854 // ParentChildPairSnapshot
829 855
830 DataCollector::DataCollector() {} 856 ParentChildPairSnapshot::ParentChildPairSnapshot(){
831
832 DataCollector::~DataCollector() {
833 } 857 }
834 858
835 void DataCollector::Append(const ThreadData& thread_data, 859 ParentChildPairSnapshot::ParentChildPairSnapshot(
836 const ThreadData::BirthMap& birth_map, 860 const ThreadData::ParentChildPair& parent_child)
837 const ThreadData::DeathMap& death_map, 861 : parent(*parent_child.first),
838 const ThreadData::ParentChildSet& parent_child_set) { 862 child(*parent_child.second) {
839 for (ThreadData::DeathMap::const_iterator it = death_map.begin();
840 it != death_map.end(); ++it) {
841 collection_.push_back(Snapshot(*it->first, thread_data, it->second));
842 global_birth_count_[it->first] -= it->first->birth_count();
843 }
844
845 for (ThreadData::BirthMap::const_iterator it = birth_map.begin();
846 it != birth_map.end(); ++it) {
847 global_birth_count_[it->second] += it->second->birth_count();
848 }
849
850 if (!kTrackParentChildLinks)
851 return;
852
853 for (ThreadData::ParentChildSet::const_iterator it = parent_child_set.begin();
854 it != parent_child_set.end(); ++it) {
855 parent_child_set_.insert(*it);
856 }
857 } 863 }
858 864
859 DataCollector::Collection* DataCollector::collection() { 865 ParentChildPairSnapshot::~ParentChildPairSnapshot() {
860 return &collection_;
861 } 866 }
862 867
863 void DataCollector::AddListOfLivingObjects() { 868 //------------------------------------------------------------------------------
864 for (BirthCount::iterator it = global_birth_count_.begin(); 869 // ProcessDataSnapshot
865 it != global_birth_count_.end(); ++it) { 870
866 if (it->second > 0) 871 ProcessDataSnapshot::ProcessDataSnapshot()
867 collection_.push_back(Snapshot(*it->first, it->second)); 872 : process_id(base::GetCurrentProcId()) {
868 }
869 } 873 }
870 874
871 void DataCollector::ToValue(base::DictionaryValue* dictionary) const { 875 ProcessDataSnapshot::~ProcessDataSnapshot() {
872 base::ListValue* list = new base::ListValue;
873 for (size_t i = 0; i < collection_.size(); ++i) {
874 list->Append(collection_[i].ToValue());
875 }
876 dictionary->Set("list", list);
877
878 base::ListValue* descendants = new base::ListValue;
879 for (ThreadData::ParentChildSet::const_iterator it =
880 parent_child_set_.begin();
881 it != parent_child_set_.end();
882 ++it) {
883 base::DictionaryValue* parent_child = new base::DictionaryValue;
884 it->first->ToValue("parent", parent_child);
885 it->second->ToValue("child", parent_child);
886 descendants->Append(parent_child);
887 }
888 dictionary->Set("descendants", descendants);
889 } 876 }
890 877
891 } // namespace tracked_objects 878 } // namespace tracked_objects
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698