void Notifier::registerClient(const tstring& sIdentifier, Notifiable* pNotifiable) { FastMutex::Guard lock(m_tableLock); NotifyTable::iterator it = m_notifyTable.find(sIdentifier); if (it == m_notifyTable.end()) { NotifyList noList; noList.push_back(pNotifiable); m_notifyTable.insert(make_pair(sIdentifier, noList)); } else { NotifyList& noList = it->second; noList.push_back(pNotifiable); } }
void nsDOMMediaQueryList::MediumFeaturesChanged(NotifyList &aListenersToNotify) { mMatchesValid = PR_FALSE; if (mListeners.Length()) { bool oldMatches = mMatches; RecomputeMatches(); if (mMatches != oldMatches) { for (PRUint32 i = 0, i_end = mListeners.Length(); i != i_end; ++i) { HandleChangeData *d = aListenersToNotify.AppendElement(); if (d) { d->mql = this; d->listener = mListeners[i]; } } } } }
void MediaQueryList::MediumFeaturesChanged(NotifyList &aListenersToNotify) { mMatchesValid = false; if (HasListeners()) { bool oldMatches = mMatches; RecomputeMatches(); if (mMatches != oldMatches) { for (uint32_t i = 0, i_end = mCallbacks.Length(); i != i_end; ++i) { HandleChangeData *d = aListenersToNotify.AppendElement(); if (d) { d->mql = this; d->callback = mCallbacks[i]; } } } } }