void SimpleCounter::requestShutdown() { Lock lock(s_outputMutex); for (CounterMap::const_iterator it = m_counters.begin(); it != m_counters.end(); ++it) { fprintf(stderr, "====================\n"); fprintf(stderr, "%s : %d\n", it->first.c_str(), it->second); if (SampleStackCount > 0) { CounterMap cm; vector<string> &stackVec = m_stacks[it->first]; for (size_t i = 0; i < stackVec.size(); i++) { cm[stackVec[i]]++; } vector<string> unique; for (CounterMap::const_iterator jt = cm.begin(); jt != cm.end(); ++jt) { unique.push_back(jt->first); } sort(unique.begin(), unique.end(), Comparer(cm)); for (size_t i = 0; i < unique.size(); i++) { fprintf(stderr, "Stack #%d: %d/%d\n", (int)(i + 1), cm[unique[i]], (int)stackVec.size()); StackTrace st(unique[i]); fprintf(stderr, "%s", st.toString().c_str()); } } } }
void RenderCounter::destroyCounterNodes(RenderObject* owner) { CounterMaps& maps = counterMaps(); CounterMaps::iterator mapsIterator = maps.find(owner); if (mapsIterator == maps.end()) return; CounterMap* map = mapsIterator->value.get(); CounterMap::const_iterator end = map->end(); for (CounterMap::const_iterator it = map->begin(); it != end; ++it) { destroyCounterNodeWithoutMapRemoval(it->key, it->value.get()); } maps.remove(mapsIterator); owner->setHasCounterNodeMap(false); }
void RenderCounter::destroyCounterNodes(RenderObject* owner) { CounterMaps& maps = counterMaps(); CounterMaps::iterator mapsIterator = maps.find(owner); if (mapsIterator == maps.end()) return; CounterMap* map = mapsIterator->second; CounterMap::const_iterator end = map->end(); for (CounterMap::const_iterator it = map->begin(); it != end; ++it) { AtomicString identifier(it->first.get()); destroyCounterNodeWithoutMapRemoval(identifier, it->second.get()); } maps.remove(mapsIterator); delete map; owner->setHasCounterNodeMap(false); }
void RenderCounter::destroyCounterNodes(RenderObject* object) { CounterMaps& maps = counterMaps(); CounterMap* map = maps.get(object); if (!map) return; maps.remove(object); CounterMap::const_iterator end = map->end(); for (CounterMap::const_iterator it = map->begin(); it != end; ++it) { CounterNode* node = it->second; destroyCounterNodeChildren(it->first.get(), node); if (CounterNode* parent = node->parent()) parent->removeChild(node); delete node; } delete map; }