| 943 | } |
| 944 | |
| 945 | void RuntimeProfileBase::AddChildLocked( |
| 946 | RuntimeProfileBase* child, bool indent, ChildVector::iterator insert_pos) { |
| 947 | children_lock_.DCheckLocked(); |
| 948 | DCHECK(child != NULL); |
| 949 | if (child_map_.count(child->name()) > 0) { |
| 950 | // This child has already been added, so do nothing. |
| 951 | // Otherwise, the map and vector will be out of sync. |
| 952 | return; |
| 953 | } |
| 954 | child_map_[child->name()] = child; |
| 955 | children_.insert(insert_pos, make_pair(child, indent)); |
| 956 | } |
| 957 | |
| 958 | void RuntimeProfile::PrependChild(RuntimeProfileBase* child, bool indent) { |
| 959 | lock_guard<SpinLock> l(children_lock_); |
no test coverage detected