Skip to content

Commit f455d2f

Browse files
committed
quic: Move DataQueueFeeder parts to header for non-windows build
1 parent 9c116a6 commit f455d2f

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

src/quic/streams.cc

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,32 +1338,6 @@ DataQueueFeeder::DataQueueFeeder(Environment* env, Local<Object> object)
13381338
MakeWeak();
13391339
}
13401340

1341-
void DataQueueFeeder::tryWakePulls() {
1342-
if (!readFinish_.IsEmpty()) {
1343-
Local<Promise::Resolver> resolver = readFinish_.Get(env()->isolate());
1344-
// I do not think, that this can error...
1345-
(void)resolver->Resolve(env()->context(), v8::True(env()->isolate()));
1346-
readFinish_.Reset();
1347-
}
1348-
}
1349-
1350-
void DataQueueFeeder::DrainAndClose() {
1351-
if (done) return;
1352-
done = true;
1353-
// do not do this several time, and note,
1354-
// it may be called several times.
1355-
while (!pendingPulls_.empty()) {
1356-
auto& pending = pendingPulls_.front();
1357-
auto pop = OnScopeLeave([this] { pendingPulls_.pop_front(); });
1358-
pending.next(bob::STATUS_EOS, nullptr, 0, [](uint64_t) {});
1359-
}
1360-
if (!readFinish_.IsEmpty()) {
1361-
Local<Promise::Resolver> resolver = readFinish_.Get(env()->isolate());
1362-
(void)resolver->Resolve(env()->context(), v8::False(env()->isolate()));
1363-
readFinish_.Reset();
1364-
}
1365-
}
1366-
13671341
JS_METHOD_IMPL(DataQueueFeeder::New) {
13681342
DCHECK(args.IsConstructCall());
13691343
auto env = Environment::GetCurrent(args);

src/quic/streams.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,32 @@ class DataQueueFeeder final : public AsyncWrap {
436436
bool done = false;
437437
};
438438

439+
void DataQueueFeeder::tryWakePulls() {
440+
if (!readFinish_.IsEmpty()) {
441+
Local<Promise::Resolver> resolver = readFinish_.Get(env()->isolate());
442+
// I do not think, that this can error...
443+
(void)resolver->Resolve(env()->context(), v8::True(env()->isolate()));
444+
readFinish_.Reset();
445+
}
446+
}
447+
448+
void DataQueueFeeder::DrainAndClose() {
449+
if (done) return;
450+
done = true;
451+
// do not do this several time, and note,
452+
// it may be called several times.
453+
while (!pendingPulls_.empty()) {
454+
auto& pending = pendingPulls_.front();
455+
auto pop = OnScopeLeave([this] { pendingPulls_.pop_front(); });
456+
pending.next(bob::STATUS_EOS, nullptr, 0, [](uint64_t) {});
457+
}
458+
if (!readFinish_.IsEmpty()) {
459+
Local<Promise::Resolver> resolver = readFinish_.Get(env()->isolate());
460+
(void)resolver->Resolve(env()->context(), v8::False(env()->isolate()));
461+
readFinish_.Reset();
462+
}
463+
}
464+
439465
} // namespace node
440466

441467
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

0 commit comments

Comments
 (0)