bool DataCue::cueContentsMatch(const TextTrackCue& cue) const { if (cue.cueType() != TextTrackCue::Data) return false; const DataCue* dataCue = toDataCue(&cue); RefPtr<ArrayBuffer> otherData = dataCue->data(); if ((otherData && !m_data) || (!otherData && m_data)) return false; if (m_data && m_data->byteLength() != otherData->byteLength()) return false; if (m_data && m_data->data() && memcmp(m_data->data(), otherData->data(), m_data->byteLength())) return false; const SerializedPlatformRepresentation* otherPlatformValue = dataCue->platformValue(); if ((otherPlatformValue && !m_platformValue) || (!otherPlatformValue && m_platformValue)) return false; if (m_platformValue && !m_platformValue->isEqual(*otherPlatformValue)) return false; JSC::JSValue thisValue = valueOrNull(); JSC::JSValue otherValue = dataCue->valueOrNull(); if ((otherValue && !thisValue) || (!otherValue && thisValue)) return false; if (!JSC::JSValue::strictEqual(nullptr, thisValue, otherValue)) return false; return true; }
ExceptionOr<void> InbandDataTextTrack::removeCue(TextTrackCue& cue) { ASSERT(cue.cueType() == TextTrackCue::Data); m_incompleteCueMap.remove(const_cast<SerializedPlatformRepresentation*>(toDataCue(&cue)->platformValue())); return InbandTextTrack::removeCue(cue); }
void InbandDataTextTrack::removeCue(TextTrackCue* cue, ExceptionCode& ec) { ASSERT(cue->cueType() == TextTrackCue::Data); SerializedPlatformRepresentation* platformValue = const_cast<SerializedPlatformRepresentation*>(toDataCue(cue)->platformValue()); auto iter = m_incompleteCueMap.find(platformValue); if (iter != m_incompleteCueMap.end()) m_incompleteCueMap.remove(platformValue); InbandTextTrack::removeCue(cue, ec); }