Ejemplo n.º 1
0
bool MutationObserverInterestGroup::isOldValueRequested()
{
    for (HashMap<RawPtr<MutationObserver>, MutationRecordDeliveryOptions>::iterator iter = m_observers.begin(); iter != m_observers.end(); ++iter) {
        if (hasOldValue(iter->value))
            return true;
    }
    return false;
}
bool MutationObserverInterestGroup::isOldValueRequested()
{
    for (auto& observer : m_observers) {
        if (hasOldValue(observer.value))
            return true;
    }
    return false;
}
Ejemplo n.º 3
0
void MutationObserverInterestGroup::enqueueMutationRecord(PassRefPtr<MutationRecord> prpMutation)
{
    RefPtr<MutationRecord> mutation = prpMutation;
    RefPtr<MutationRecord> mutationWithNullOldValue = nullptr;
    for (HashMap<RawPtr<MutationObserver>, MutationRecordDeliveryOptions>::iterator iter = m_observers.begin(); iter != m_observers.end(); ++iter) {
        MutationObserver* observer = iter->key;
        if (hasOldValue(iter->value)) {
            observer->enqueueMutationRecord(mutation);
            continue;
        }
        if (!mutationWithNullOldValue) {
            if (mutation->oldValue().isNull())
                mutationWithNullOldValue = mutation;
            else
                mutationWithNullOldValue = MutationRecord::createWithNullOldValue(mutation).get();
        }
        observer->enqueueMutationRecord(mutationWithNullOldValue);
    }
}
void MutationObserverInterestGroup::enqueueMutationRecord(PassRefPtrWillBeRawPtr<MutationRecord> prpMutation)
{
    RefPtrWillBeRawPtr<MutationRecord> mutation = prpMutation;
    RefPtrWillBeRawPtr<MutationRecord> mutationWithNullOldValue = nullptr;
    for (auto& iter : m_observers) {
        MutationObserver* observer = iter.key;
        if (hasOldValue(iter.value)) {
            observer->enqueueMutationRecord(mutation);
            continue;
        }
        if (!mutationWithNullOldValue) {
            if (mutation->oldValue().isNull())
                mutationWithNullOldValue = mutation;
            else
                mutationWithNullOldValue = MutationRecord::createWithNullOldValue(mutation).get();
        }
        observer->enqueueMutationRecord(mutationWithNullOldValue);
    }
}