Beispiel #1
0
HeapVector<Member<ArchiveResource>> MHTMLParser::parseArchive() {
  MIMEHeader* header = MIMEHeader::parseHeader(&m_lineReader);
  HeapVector<Member<ArchiveResource>> resources;
  if (!parseArchiveWithHeader(header, resources))
    resources.clear();
  return resources;
}
void InsertParagraphSeparatorCommand::getAncestorsInsideBlock(const Node* insertionNode, Element* outerBlock, HeapVector<Member<Element>>& ancestors)
{
    ancestors.clear();

    // Build up list of ancestors elements between the insertion node and the outer block.
    if (insertionNode != outerBlock) {
        for (Element* n = insertionNode->parentElement(); n && n != outerBlock; n = n->parentElement())
            ancestors.append(n);
    }
}
Beispiel #3
0
void RTCDataChannel::scheduledEventTimerFired(Timer<RTCDataChannel>*)
{
    HeapVector<Member<Event>> events;
    events.swap(m_scheduledEvents);

    HeapVector<Member<Event>>::iterator it = events.begin();
    for (; it != events.end(); ++it)
        dispatchEvent((*it).release());

    events.clear();
}
Beispiel #4
0
void MediaStream::scheduledEventTimerFired(TimerBase*) {
  if (m_executionContext->isContextDestroyed())
    return;

  HeapVector<Member<Event>> events;
  events.swap(m_scheduledEvents);

  HeapVector<Member<Event>>::iterator it = events.begin();
  for (; it != events.end(); ++it)
    dispatchEvent((*it).release());

  events.clear();
}
Beispiel #5
0
MIDIOutputMap* MIDIAccess::outputs() const {
  HeapVector<Member<MIDIOutput>> outputs;
  HashSet<String> ids;
  for (size_t i = 0; i < m_outputs.size(); ++i) {
    MIDIOutput* output = m_outputs[i];
    if (output->getState() != PortState::DISCONNECTED) {
      outputs.append(output);
      ids.add(output->id());
    }
  }
  if (outputs.size() != ids.size()) {
    // There is id duplication that violates the spec.
    outputs.clear();
  }
  return new MIDIOutputMap(outputs);
}
MIDIInputMap* MIDIAccess::inputs() const
{
    HeapVector<Member<MIDIInput>> inputs;
    HashSet<String> ids;
    for (size_t i = 0; i < m_inputs.size(); ++i) {
        MIDIInput* input = m_inputs[i];
        if (input->getState() != PortState::MIDIPortStateDisconnected) {
            inputs.append(input);
            ids.add(input->id());
        }
    }
    if (inputs.size() != ids.size()) {
        // There is id duplication that violates the spec.
        inputs.clear();
    }
    return new MIDIInputMap(inputs);
}
Beispiel #7
0
inline void DistributionPool::clear() {
  detachNonDistributedNodes();
  m_nodes.clear();
  m_distributed.clear();
}