@@ -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 ());
@@ -745,26 +747,6 @@ class Parser : public AsyncWrap, public StreamListener {
745747 }
746748 }
747749
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-
768750 protected:
769751 static const size_t kAllocBufferSize = 64 * 1024 ;
770752
@@ -1317,8 +1299,6 @@ void CreatePerIsolateProperties(IsolateData* isolate_data,
13171299 SetProtoMethod (isolate, t, " consume" , Parser::Consume);
13181300 SetProtoMethod (isolate, t, " unconsume" , Parser::Unconsume);
13191301 SetProtoMethod (isolate, t, " getCurrentBuffer" , Parser::GetCurrentBuffer);
1320- SetProtoMethod (isolate, t, " duration" , Parser::Duration);
1321- SetProtoMethod (isolate, t, " headersCompleted" , Parser::HeadersCompleted);
13221302
13231303 SetConstructorFunction (isolate, target, " HTTPParser" , t);
13241304
@@ -1388,8 +1368,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
13881368 registry->Register (Parser::Consume);
13891369 registry->Register (Parser::Unconsume);
13901370 registry->Register (Parser::GetCurrentBuffer);
1391- registry->Register (Parser::Duration);
1392- registry->Register (Parser::HeadersCompleted);
13931371 registry->Register (ConnectionsList::New);
13941372 registry->Register (ConnectionsList::All);
13951373 registry->Register (ConnectionsList::Idle);
0 commit comments