fix: correctly handle nexttick scheduling in stream reads (#24022)

This commit is contained in:
Paul Frazee 2020-06-11 11:55:59 -05:00 committed by GitHub
parent 130b176796
commit 81d09bea44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 1 deletions

View file

@ -87,6 +87,11 @@ class NodeStreamLoader : public network::mojom::URLLoader {
// flag.
bool readable_ = false;
// It's possible for reads to be queued using nextTick() during read()
// which will cause 'readable' to emit during ReadMore, so we track if
// that occurred in a flag.
bool has_read_waiting_ = false;
// Store the V8 callbacks to unsubscribe them later.
std::map<std::string, v8::Global<v8::Value>> handlers_;