Exemplo n.º 1
0
static inline void startReadableStreamAsync(ReadableStream& stream)
{
    RefPtr<ReadableStream> protectedStream = &stream;
    stream.scriptExecutionContext()->postTask([protectedStream](ScriptExecutionContext&) {
        protectedStream->start();
    });
}
Exemplo n.º 2
0
ReadableStreamReader::ReadableStreamReader(ReadableStream& stream)
    : ActiveDOMObject(stream.scriptExecutionContext())
{
#ifndef NDEBUG
    readableStreamReaderCounter.increment();
#endif
    suspendIfNeeded();
    ASSERT_WITH_MESSAGE(!stream.reader(), "A ReadableStream cannot be locked by two readers at the same time.");
    m_stream = &stream;
    stream.lock(*this);
}