diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc index 25aa204ee2c..26ddbf57854 100644 --- a/src/node_http_parser.cc +++ b/src/node_http_parser.cc @@ -563,7 +563,7 @@ class Parser : public AsyncWrap, public StreamListener { new Parser(binding_data, args.This()); } - + // TODO(@anonrig): Add V8 Fast API static void Close(const FunctionCallbackInfo& args) { Parser* parser; ASSIGN_OR_RETURN_UNWRAP(&parser, args.This()); @@ -571,7 +571,7 @@ class Parser : public AsyncWrap, public StreamListener { delete parser; } - + // TODO(@anonrig): Add V8 Fast API static void Free(const FunctionCallbackInfo& args) { Parser* parser; ASSIGN_OR_RETURN_UNWRAP(&parser, args.This()); @@ -582,6 +582,7 @@ class Parser : public AsyncWrap, public StreamListener { parser->EmitDestroy(); } + // TODO(@anonrig): Add V8 Fast API static void Remove(const FunctionCallbackInfo& args) { Parser* parser; ASSIGN_OR_RETURN_UNWRAP(&parser, args.This()); @@ -694,6 +695,7 @@ class Parser : public AsyncWrap, public StreamListener { } } + // TODO(@anonrig): Add V8 Fast API template static void Pause(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -709,7 +711,7 @@ class Parser : public AsyncWrap, public StreamListener { } } - + // TODO(@anonrig): Add V8 Fast API static void Consume(const FunctionCallbackInfo& args) { Parser* parser; ASSIGN_OR_RETURN_UNWRAP(&parser, args.This()); @@ -719,7 +721,7 @@ class Parser : public AsyncWrap, public StreamListener { stream->PushStreamListener(parser); } - + // TODO(@anonrig): Add V8 Fast API static void Unconsume(const FunctionCallbackInfo& args) { Parser* parser; ASSIGN_OR_RETURN_UNWRAP(&parser, args.This()); @@ -745,26 +747,6 @@ class Parser : public AsyncWrap, public StreamListener { } } - static void Duration(const FunctionCallbackInfo& args) { - Parser* parser; - ASSIGN_OR_RETURN_UNWRAP(&parser, args.This()); - - if (parser->last_message_start_ == 0) { - args.GetReturnValue().Set(0); - return; - } - - double duration = (uv_hrtime() - parser->last_message_start_) / 1e6; - args.GetReturnValue().Set(duration); - } - - static void HeadersCompleted(const FunctionCallbackInfo& args) { - Parser* parser; - ASSIGN_OR_RETURN_UNWRAP(&parser, args.This()); - - args.GetReturnValue().Set(parser->headers_completed_); - } - protected: static const size_t kAllocBufferSize = 64 * 1024; @@ -1317,8 +1299,6 @@ void CreatePerIsolateProperties(IsolateData* isolate_data, SetProtoMethod(isolate, t, "consume", Parser::Consume); SetProtoMethod(isolate, t, "unconsume", Parser::Unconsume); SetProtoMethod(isolate, t, "getCurrentBuffer", Parser::GetCurrentBuffer); - SetProtoMethod(isolate, t, "duration", Parser::Duration); - SetProtoMethod(isolate, t, "headersCompleted", Parser::HeadersCompleted); SetConstructorFunction(isolate, target, "HTTPParser", t); @@ -1388,8 +1368,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) { registry->Register(Parser::Consume); registry->Register(Parser::Unconsume); registry->Register(Parser::GetCurrentBuffer); - registry->Register(Parser::Duration); - registry->Register(Parser::HeadersCompleted); registry->Register(ConnectionsList::New); registry->Register(ConnectionsList::All); registry->Register(ConnectionsList::Idle);