| 923 | } |
| 924 | |
| 925 | void RuntimeProfile::AddChild( |
| 926 | RuntimeProfileBase* child, bool indent, RuntimeProfile* loc) { |
| 927 | lock_guard<SpinLock> l(children_lock_); |
| 928 | ChildVector::iterator insert_pos; |
| 929 | if (loc == NULL) { |
| 930 | insert_pos = children_.end(); |
| 931 | } else { |
| 932 | bool found = false; |
| 933 | for (ChildVector::iterator it = children_.begin(); it != children_.end(); ++it) { |
| 934 | if (it->first == loc) { |
| 935 | insert_pos = it + 1; |
| 936 | found = true; |
| 937 | break; |
| 938 | } |
| 939 | } |
| 940 | DCHECK(found) << "Invalid loc"; |
| 941 | } |
| 942 | AddChildLocked(child, indent, insert_pos); |
| 943 | } |
| 944 | |
| 945 | void RuntimeProfileBase::AddChildLocked( |
| 946 | RuntimeProfileBase* child, bool indent, ChildVector::iterator insert_pos) { |