1111#include " node_http_common.h"
1212#include " node_mem.h"
1313#include " node_perf.h"
14- #include " stream_base-inl .h"
14+ #include " stream_base.h"
1515#include " string_bytes.h"
1616
1717#include < algorithm>
2020namespace node {
2121namespace http2 {
2222
23- using v8::Array;
24- using v8::Context;
25- using v8::Isolate;
26- using v8::MaybeLocal;
27-
28- using performance::PerformanceEntry;
29-
3023// We strictly limit the number of outstanding unacknowledged PINGS a user
3124// may send in order to prevent abuse. The current default cap is 10. The
3225// user may set a different limit using a per Http2Session configuration
@@ -169,7 +162,7 @@ class Http2Scope {
169162
170163 private:
171164 Http2Session* session_ = nullptr ;
172- Local<Object> session_handle_;
165+ v8:: Local<v8:: Object> session_handle_;
173166};
174167
175168// The Http2Options class is used to parse the options object passed in to
@@ -240,9 +233,9 @@ class Http2Options {
240233class Http2Priority {
241234 public:
242235 Http2Priority (Environment* env,
243- Local<Value> parent,
244- Local<Value> weight,
245- Local<Value> exclusive);
236+ v8:: Local<v8:: Value> parent,
237+ v8:: Local<v8:: Value> weight,
238+ v8:: Local<v8:: Value> exclusive);
246239
247240 nghttp2_priority_spec* operator *() {
248241 return &spec;
@@ -410,15 +403,15 @@ class Http2Stream : public AsyncWrap,
410403 std::string diagnostic_name () const override ;
411404
412405 // JavaScript API
413- static void GetID (const FunctionCallbackInfo<Value>& args);
414- static void Destroy (const FunctionCallbackInfo<Value>& args);
415- static void Priority (const FunctionCallbackInfo<Value>& args);
416- static void PushPromise (const FunctionCallbackInfo<Value>& args);
417- static void RefreshState (const FunctionCallbackInfo<Value>& args);
418- static void Info (const FunctionCallbackInfo<Value>& args);
419- static void Trailers (const FunctionCallbackInfo<Value>& args);
420- static void Respond (const FunctionCallbackInfo<Value>& args);
421- static void RstStream (const FunctionCallbackInfo<Value>& args);
406+ static void GetID (const v8:: FunctionCallbackInfo<v8:: Value>& args);
407+ static void Destroy (const v8:: FunctionCallbackInfo<v8:: Value>& args);
408+ static void Priority (const v8:: FunctionCallbackInfo<v8:: Value>& args);
409+ static void PushPromise (const v8:: FunctionCallbackInfo<v8:: Value>& args);
410+ static void RefreshState (const v8:: FunctionCallbackInfo<v8:: Value>& args);
411+ static void Info (const v8:: FunctionCallbackInfo<v8:: Value>& args);
412+ static void Trailers (const v8:: FunctionCallbackInfo<v8:: Value>& args);
413+ static void Respond (const v8:: FunctionCallbackInfo<v8:: Value>& args);
414+ static void RstStream (const v8:: FunctionCallbackInfo<v8:: Value>& args);
422415
423416 class Provider ;
424417
@@ -540,7 +533,7 @@ class Http2Session : public AsyncWrap,
540533 public mem::NgLibMemoryManager<Http2Session, nghttp2_mem> {
541534 public:
542535 Http2Session (Environment* env,
543- Local<Object> wrap,
536+ v8:: Local<v8:: Object> wrap,
544537 nghttp2_session_type type = NGHTTP2_SESSION_SERVER);
545538 ~Http2Session () override ;
546539
@@ -555,7 +548,7 @@ class Http2Session : public AsyncWrap,
555548
556549 void Close (uint32_t code = NGHTTP2_NO_ERROR,
557550 bool socket_closed = false );
558- void Consume (Local<Object> stream);
551+ void Consume (v8:: Local<v8:: Object> stream);
559552 void Goaway (uint32_t code, int32_t lastStreamID,
560553 const uint8_t * data, size_t len);
561554 void AltSvc (int32_t id,
@@ -652,21 +645,21 @@ class Http2Session : public AsyncWrap,
652645 void DecreaseAllocatedSize (size_t size);
653646
654647 // The JavaScript API
655- static void New (const FunctionCallbackInfo<Value>& args);
656- static void Consume (const FunctionCallbackInfo<Value>& args);
657- static void Destroy (const FunctionCallbackInfo<Value>& args);
658- static void Settings (const FunctionCallbackInfo<Value>& args);
659- static void Request (const FunctionCallbackInfo<Value>& args);
660- static void SetNextStreamID (const FunctionCallbackInfo<Value>& args);
661- static void Goaway (const FunctionCallbackInfo<Value>& args);
662- static void UpdateChunksSent (const FunctionCallbackInfo<Value>& args);
663- static void RefreshState (const FunctionCallbackInfo<Value>& args);
664- static void Ping (const FunctionCallbackInfo<Value>& args);
665- static void AltSvc (const FunctionCallbackInfo<Value>& args);
666- static void Origin (const FunctionCallbackInfo<Value>& args);
648+ static void New (const v8:: FunctionCallbackInfo<v8:: Value>& args);
649+ static void Consume (const v8:: FunctionCallbackInfo<v8:: Value>& args);
650+ static void Destroy (const v8:: FunctionCallbackInfo<v8:: Value>& args);
651+ static void Settings (const v8:: FunctionCallbackInfo<v8:: Value>& args);
652+ static void Request (const v8:: FunctionCallbackInfo<v8:: Value>& args);
653+ static void SetNextStreamID (const v8:: FunctionCallbackInfo<v8:: Value>& args);
654+ static void Goaway (const v8:: FunctionCallbackInfo<v8:: Value>& args);
655+ static void UpdateChunksSent (const v8:: FunctionCallbackInfo<v8:: Value>& args);
656+ static void RefreshState (const v8:: FunctionCallbackInfo<v8:: Value>& args);
657+ static void Ping (const v8:: FunctionCallbackInfo<v8:: Value>& args);
658+ static void AltSvc (const v8:: FunctionCallbackInfo<v8:: Value>& args);
659+ static void Origin (const v8:: FunctionCallbackInfo<v8:: Value>& args);
667660
668661 template <get_setting fn>
669- static void RefreshSettings (const FunctionCallbackInfo<Value>& args);
662+ static void RefreshSettings (const v8:: FunctionCallbackInfo<v8:: Value>& args);
670663
671664 uv_loop_t * event_loop () const {
672665 return env ()->event_loop ();
@@ -876,15 +869,16 @@ class Http2Session : public AsyncWrap,
876869 friend class Http2StreamListener ;
877870};
878871
879- class Http2SessionPerformanceEntry : public PerformanceEntry {
872+ class Http2SessionPerformanceEntry : public performance :: PerformanceEntry {
880873 public:
881874 Http2SessionPerformanceEntry (
882875 Environment* env,
883876 const Http2Session::Statistics& stats,
884877 nghttp2_session_type type) :
885- PerformanceEntry (env, " Http2Session" , " http2" ,
886- stats.start_time,
887- stats.end_time),
878+ performance::PerformanceEntry (
879+ env, " Http2Session" , " http2" ,
880+ stats.start_time,
881+ stats.end_time),
888882 ping_rtt_ (stats.ping_rtt),
889883 data_sent_ (stats.data_sent),
890884 data_received_ (stats.data_received),
@@ -905,8 +899,8 @@ class Http2SessionPerformanceEntry : public PerformanceEntry {
905899 double stream_average_duration () const { return stream_average_duration_; }
906900 nghttp2_session_type type () const { return session_type_; }
907901
908- void Notify (Local<Value> obj) {
909- PerformanceEntry::Notify (env (), kind (), obj);
902+ void Notify (v8:: Local<v8:: Value> obj) {
903+ performance:: PerformanceEntry::Notify (env (), kind (), obj);
910904 }
911905
912906 private:
@@ -921,15 +915,17 @@ class Http2SessionPerformanceEntry : public PerformanceEntry {
921915 nghttp2_session_type session_type_;
922916};
923917
924- class Http2StreamPerformanceEntry : public PerformanceEntry {
918+ class Http2StreamPerformanceEntry
919+ : public performance::PerformanceEntry {
925920 public:
926921 Http2StreamPerformanceEntry (
927922 Environment* env,
928923 int32_t id,
929924 const Http2Stream::Statistics& stats) :
930- PerformanceEntry (env, " Http2Stream" , " http2" ,
931- stats.start_time,
932- stats.end_time),
925+ performance::PerformanceEntry (
926+ env, " Http2Stream" , " http2" ,
927+ stats.start_time,
928+ stats.end_time),
933929 id_ (id),
934930 first_header_ (stats.first_header),
935931 first_byte_ (stats.first_byte),
@@ -944,8 +940,8 @@ class Http2StreamPerformanceEntry : public PerformanceEntry {
944940 uint64_t sent_bytes () const { return sent_bytes_; }
945941 uint64_t received_bytes () const { return received_bytes_; }
946942
947- void Notify (Local<Value> obj) {
948- PerformanceEntry::Notify (env (), kind (), obj);
943+ void Notify (v8:: Local<v8:: Value> obj) {
944+ performance:: PerformanceEntry::Notify (env (), kind (), obj);
949945 }
950946
951947 private:
@@ -998,7 +994,7 @@ class Http2Session::Http2Settings : public AsyncWrap {
998994 void Done (bool ack);
999995
1000996 // Returns a Buffer instance with the serialized SETTINGS payload
1001- Local<Value> Pack ();
997+ v8:: Local<v8:: Value> Pack ();
1002998
1003999 // Resets the default values in the settings buffer
10041000 static void RefreshDefaults (Environment* env);
@@ -1018,9 +1014,9 @@ class Http2Session::Http2Settings : public AsyncWrap {
10181014
10191015class Origins {
10201016 public:
1021- Origins (Isolate* isolate,
1022- Local<Context> context,
1023- Local<v8::String> origin_string,
1017+ Origins (v8:: Isolate* isolate,
1018+ v8:: Local<v8:: Context> context,
1019+ v8:: Local<v8::String> origin_string,
10241020 size_t origin_count);
10251021 ~Origins () = default ;
10261022
0 commit comments