Exemplo n.º 1
0
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);
    }
}
Exemplo n.º 2
0
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];
        }
      }
    }
  }
}
Exemplo n.º 3
0
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];
        }
      }
    }
  }
}