@@ -563,15 +563,15 @@ class Parser : public AsyncWrap, public StreamListener {
563
563
new Parser (binding_data, args.This ());
564
564
}
565
565
566
-
566
+ // TODO(@anonrig): Add V8 Fast API
567
567
static void Close (const FunctionCallbackInfo<Value>& args) {
568
568
Parser* parser;
569
569
ASSIGN_OR_RETURN_UNWRAP (&parser, args.This ());
570
570
571
571
delete parser;
572
572
}
573
573
574
-
574
+ // TODO(@anonrig): Add V8 Fast API
575
575
static void Free (const FunctionCallbackInfo<Value>& args) {
576
576
Parser* parser;
577
577
ASSIGN_OR_RETURN_UNWRAP (&parser, args.This ());
@@ -582,6 +582,7 @@ class Parser : public AsyncWrap, public StreamListener {
582
582
parser->EmitDestroy ();
583
583
}
584
584
585
+ // TODO(@anonrig): Add V8 Fast API
585
586
static void Remove (const FunctionCallbackInfo<Value>& args) {
586
587
Parser* parser;
587
588
ASSIGN_OR_RETURN_UNWRAP (&parser, args.This ());
@@ -694,6 +695,7 @@ class Parser : public AsyncWrap, public StreamListener {
694
695
}
695
696
}
696
697
698
+ // TODO(@anonrig): Add V8 Fast API
697
699
template <bool should_pause>
698
700
static void Pause (const FunctionCallbackInfo<Value>& args) {
699
701
Environment* env = Environment::GetCurrent (args);
@@ -709,7 +711,7 @@ class Parser : public AsyncWrap, public StreamListener {
709
711
}
710
712
}
711
713
712
-
714
+ // TODO(@anonrig): Add V8 Fast API
713
715
static void Consume (const FunctionCallbackInfo<Value>& args) {
714
716
Parser* parser;
715
717
ASSIGN_OR_RETURN_UNWRAP (&parser, args.This ());
@@ -719,7 +721,7 @@ class Parser : public AsyncWrap, public StreamListener {
719
721
stream->PushStreamListener (parser);
720
722
}
721
723
722
-
724
+ // TODO(@anonrig): Add V8 Fast API
723
725
static void Unconsume (const FunctionCallbackInfo<Value>& args) {
724
726
Parser* parser;
725
727
ASSIGN_OR_RETURN_UNWRAP (&parser, args.This ());
@@ -745,26 +747,6 @@ class Parser : public AsyncWrap, public StreamListener {
745
747
}
746
748
}
747
749
748
- static void Duration (const FunctionCallbackInfo<Value>& args) {
749
- Parser* parser;
750
- ASSIGN_OR_RETURN_UNWRAP (&parser, args.This ());
751
-
752
- if (parser->last_message_start_ == 0 ) {
753
- args.GetReturnValue ().Set (0 );
754
- return ;
755
- }
756
-
757
- double duration = (uv_hrtime () - parser->last_message_start_ ) / 1e6 ;
758
- args.GetReturnValue ().Set (duration);
759
- }
760
-
761
- static void HeadersCompleted (const FunctionCallbackInfo<Value>& args) {
762
- Parser* parser;
763
- ASSIGN_OR_RETURN_UNWRAP (&parser, args.This ());
764
-
765
- args.GetReturnValue ().Set (parser->headers_completed_ );
766
- }
767
-
768
750
protected:
769
751
static const size_t kAllocBufferSize = 64 * 1024 ;
770
752
@@ -1317,8 +1299,6 @@ void CreatePerIsolateProperties(IsolateData* isolate_data,
1317
1299
SetProtoMethod (isolate, t, " consume" , Parser::Consume);
1318
1300
SetProtoMethod (isolate, t, " unconsume" , Parser::Unconsume);
1319
1301
SetProtoMethod (isolate, t, " getCurrentBuffer" , Parser::GetCurrentBuffer);
1320
- SetProtoMethod (isolate, t, " duration" , Parser::Duration);
1321
- SetProtoMethod (isolate, t, " headersCompleted" , Parser::HeadersCompleted);
1322
1302
1323
1303
SetConstructorFunction (isolate, target, " HTTPParser" , t);
1324
1304
@@ -1388,8 +1368,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
1388
1368
registry->Register (Parser::Consume);
1389
1369
registry->Register (Parser::Unconsume);
1390
1370
registry->Register (Parser::GetCurrentBuffer);
1391
- registry->Register (Parser::Duration);
1392
- registry->Register (Parser::HeadersCompleted);
1393
1371
registry->Register (ConnectionsList::New);
1394
1372
registry->Register (ConnectionsList::All);
1395
1373
registry->Register (ConnectionsList::Idle);
0 commit comments