Skip to content

Commit 5298da0

Browse files
anonrigaduh95
authored andcommitted
http: remove unused functions and add todos
PR-URL: #58143 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]>
1 parent a793706 commit 5298da0

File tree

1 file changed

+6
-28
lines changed

1 file changed

+6
-28
lines changed

src/node_http_parser.cc

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -563,15 +563,15 @@ class Parser : public AsyncWrap, public StreamListener {
563563
new Parser(binding_data, args.This());
564564
}
565565

566-
566+
// TODO(@anonrig): Add V8 Fast API
567567
static void Close(const FunctionCallbackInfo<Value>& args) {
568568
Parser* parser;
569569
ASSIGN_OR_RETURN_UNWRAP(&parser, args.This());
570570

571571
delete parser;
572572
}
573573

574-
574+
// TODO(@anonrig): Add V8 Fast API
575575
static void Free(const FunctionCallbackInfo<Value>& args) {
576576
Parser* parser;
577577
ASSIGN_OR_RETURN_UNWRAP(&parser, args.This());
@@ -582,6 +582,7 @@ class Parser : public AsyncWrap, public StreamListener {
582582
parser->EmitDestroy();
583583
}
584584

585+
// TODO(@anonrig): Add V8 Fast API
585586
static void Remove(const FunctionCallbackInfo<Value>& args) {
586587
Parser* parser;
587588
ASSIGN_OR_RETURN_UNWRAP(&parser, args.This());
@@ -694,6 +695,7 @@ class Parser : public AsyncWrap, public StreamListener {
694695
}
695696
}
696697

698+
// TODO(@anonrig): Add V8 Fast API
697699
template <bool should_pause>
698700
static void Pause(const FunctionCallbackInfo<Value>& args) {
699701
Environment* env = Environment::GetCurrent(args);
@@ -709,7 +711,7 @@ class Parser : public AsyncWrap, public StreamListener {
709711
}
710712
}
711713

712-
714+
// TODO(@anonrig): Add V8 Fast API
713715
static void Consume(const FunctionCallbackInfo<Value>& args) {
714716
Parser* parser;
715717
ASSIGN_OR_RETURN_UNWRAP(&parser, args.This());
@@ -719,7 +721,7 @@ class Parser : public AsyncWrap, public StreamListener {
719721
stream->PushStreamListener(parser);
720722
}
721723

722-
724+
// TODO(@anonrig): Add V8 Fast API
723725
static void Unconsume(const FunctionCallbackInfo<Value>& args) {
724726
Parser* parser;
725727
ASSIGN_OR_RETURN_UNWRAP(&parser, args.This());
@@ -744,26 +746,6 @@ class Parser : public AsyncWrap, public StreamListener {
744746
args.GetReturnValue().Set(ret);
745747
}
746748

747-
static void Duration(const FunctionCallbackInfo<Value>& args) {
748-
Parser* parser;
749-
ASSIGN_OR_RETURN_UNWRAP(&parser, args.This());
750-
751-
if (parser->last_message_start_ == 0) {
752-
args.GetReturnValue().Set(0);
753-
return;
754-
}
755-
756-
double duration = (uv_hrtime() - parser->last_message_start_) / 1e6;
757-
args.GetReturnValue().Set(duration);
758-
}
759-
760-
static void HeadersCompleted(const FunctionCallbackInfo<Value>& args) {
761-
Parser* parser;
762-
ASSIGN_OR_RETURN_UNWRAP(&parser, args.This());
763-
764-
args.GetReturnValue().Set(parser->headers_completed_);
765-
}
766-
767749
protected:
768750
static const size_t kAllocBufferSize = 64 * 1024;
769751

@@ -1316,8 +1298,6 @@ void CreatePerIsolateProperties(IsolateData* isolate_data,
13161298
SetProtoMethod(isolate, t, "consume", Parser::Consume);
13171299
SetProtoMethod(isolate, t, "unconsume", Parser::Unconsume);
13181300
SetProtoMethod(isolate, t, "getCurrentBuffer", Parser::GetCurrentBuffer);
1319-
SetProtoMethod(isolate, t, "duration", Parser::Duration);
1320-
SetProtoMethod(isolate, t, "headersCompleted", Parser::HeadersCompleted);
13211301

13221302
SetConstructorFunction(isolate, target, "HTTPParser", t);
13231303

@@ -1387,8 +1367,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
13871367
registry->Register(Parser::Consume);
13881368
registry->Register(Parser::Unconsume);
13891369
registry->Register(Parser::GetCurrentBuffer);
1390-
registry->Register(Parser::Duration);
1391-
registry->Register(Parser::HeadersCompleted);
13921370
registry->Register(ConnectionsList::New);
13931371
registry->Register(ConnectionsList::All);
13941372
registry->Register(ConnectionsList::Idle);

0 commit comments

Comments
 (0)