void JavaScriptDebugServer::removeListener(JavaScriptDebugListener* listener, Page* page) { ASSERT_ARG(listener, listener); ASSERT_ARG(page, page); PageListenersMap::iterator it = m_pageListenersMap.find(page); if (it == m_pageListenersMap.end()) return; ListenerSet* listeners = it->second; listeners->remove(listener); if (listeners->isEmpty()) { m_pageListenersMap.remove(it); delete listeners; } didRemoveListener(page); if (!hasListeners()) didRemoveLastListener(); }
void JavaScriptDebugServer::removeListener(JavaScriptDebugListener* listener, Page* page) { ASSERT_ARG(page, page); PageListenersMap::iterator it = m_pageListenersMap.find(page); if (it == m_pageListenersMap.end()) return; ListenerSet* listeners = it->second; listeners->remove(listener); if (listeners->isEmpty()) { m_pageListenersMap.remove(it); delete listeners; } if (!hasListeners()) { Page::setDebuggerForAllPages(0); m_doneProcessingDebuggerEvents = true; } }