WebContext::~WebContext() { ASSERT(contexts().find(this) != notFound); contexts().remove(contexts().find(this)); removeLanguageChangeObserver(this); m_messageReceiverMap.invalidate(); WebContextSupplementMap::const_iterator it = m_supplements.begin(); WebContextSupplementMap::const_iterator end = m_supplements.end(); for (; it != end; ++it) { it->value->contextDestroyed(); it->value->clearContext(); } m_iconDatabase->invalidate(); m_iconDatabase->clearContext(); #if ENABLE(NETSCAPE_PLUGIN_API) m_pluginSiteDataManager->invalidate(); m_pluginSiteDataManager->clearContext(); #endif invalidateCallbackMap(m_dictionaryCallbacks); platformInvalidateContext(); #if ENABLE(NETSCAPE_PLUGIN_API) m_pluginInfoStore.setClient(0); #endif #ifndef NDEBUG webContextCounter.decrement(); #endif }
WebProcessPool::~WebProcessPool() { bool removed = processPools().removeFirst(this); ASSERT_UNUSED(removed, removed); removeLanguageChangeObserver(this); m_messageReceiverMap.invalidate(); WebContextSupplementMap::const_iterator it = m_supplements.begin(); WebContextSupplementMap::const_iterator end = m_supplements.end(); for (; it != end; ++it) { it->value->processPoolDestroyed(); it->value->clearProcessPool(); } m_iconDatabase->invalidate(); m_iconDatabase->clearProcessPool(); WebIconDatabase* rawIconDatabase = m_iconDatabase.release().leakRef(); rawIconDatabase->derefWhenAppropriate(); invalidateCallbackMap(m_dictionaryCallbacks, CallbackBase::Error::OwnerWasInvalidated); platformInvalidateContext(); #if ENABLE(NETSCAPE_PLUGIN_API) m_pluginInfoStore.setClient(0); #endif #ifndef NDEBUG processPoolCounter.decrement(); #endif if (m_networkProcess) m_networkProcess->shutDownProcess(); }