11
11
#include " node_http_common.h"
12
12
#include " node_mem.h"
13
13
#include " node_perf.h"
14
- #include " stream_base-inl .h"
14
+ #include " stream_base.h"
15
15
#include " string_bytes.h"
16
16
17
17
#include < algorithm>
20
20
namespace node {
21
21
namespace http2 {
22
22
23
- using v8::Array;
24
- using v8::Context;
25
- using v8::Isolate;
26
- using v8::MaybeLocal;
27
-
28
- using performance::PerformanceEntry;
29
-
30
23
// We strictly limit the number of outstanding unacknowledged PINGS a user
31
24
// may send in order to prevent abuse. The current default cap is 10. The
32
25
// user may set a different limit using a per Http2Session configuration
@@ -169,7 +162,7 @@ class Http2Scope {
169
162
170
163
private:
171
164
Http2Session* session_ = nullptr ;
172
- Local<Object> session_handle_;
165
+ v8:: Local<v8:: Object> session_handle_;
173
166
};
174
167
175
168
// The Http2Options class is used to parse the options object passed in to
@@ -240,9 +233,9 @@ class Http2Options {
240
233
class Http2Priority {
241
234
public:
242
235
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);
246
239
247
240
nghttp2_priority_spec* operator *() {
248
241
return &spec;
@@ -410,15 +403,15 @@ class Http2Stream : public AsyncWrap,
410
403
std::string diagnostic_name () const override ;
411
404
412
405
// 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);
422
415
423
416
class Provider ;
424
417
@@ -540,7 +533,7 @@ class Http2Session : public AsyncWrap,
540
533
public mem::NgLibMemoryManager<Http2Session, nghttp2_mem> {
541
534
public:
542
535
Http2Session (Environment* env,
543
- Local<Object> wrap,
536
+ v8:: Local<v8:: Object> wrap,
544
537
nghttp2_session_type type = NGHTTP2_SESSION_SERVER);
545
538
~Http2Session () override ;
546
539
@@ -555,7 +548,7 @@ class Http2Session : public AsyncWrap,
555
548
556
549
void Close (uint32_t code = NGHTTP2_NO_ERROR,
557
550
bool socket_closed = false );
558
- void Consume (Local<Object> stream);
551
+ void Consume (v8:: Local<v8:: Object> stream);
559
552
void Goaway (uint32_t code, int32_t lastStreamID,
560
553
const uint8_t * data, size_t len);
561
554
void AltSvc (int32_t id,
@@ -652,21 +645,21 @@ class Http2Session : public AsyncWrap,
652
645
void DecreaseAllocatedSize (size_t size);
653
646
654
647
// 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);
667
660
668
661
template <get_setting fn>
669
- static void RefreshSettings (const FunctionCallbackInfo<Value>& args);
662
+ static void RefreshSettings (const v8:: FunctionCallbackInfo<v8:: Value>& args);
670
663
671
664
uv_loop_t * event_loop () const {
672
665
return env ()->event_loop ();
@@ -877,15 +870,16 @@ class Http2Session : public AsyncWrap,
877
870
friend class Http2StreamListener ;
878
871
};
879
872
880
- class Http2SessionPerformanceEntry : public PerformanceEntry {
873
+ class Http2SessionPerformanceEntry : public performance :: PerformanceEntry {
881
874
public:
882
875
Http2SessionPerformanceEntry (
883
876
Environment* env,
884
877
const Http2Session::Statistics& stats,
885
878
nghttp2_session_type type) :
886
- PerformanceEntry (env, " Http2Session" , " http2" ,
887
- stats.start_time,
888
- stats.end_time),
879
+ performance::PerformanceEntry (
880
+ env, " Http2Session" , " http2" ,
881
+ stats.start_time,
882
+ stats.end_time),
889
883
ping_rtt_ (stats.ping_rtt),
890
884
data_sent_ (stats.data_sent),
891
885
data_received_ (stats.data_received),
@@ -906,8 +900,8 @@ class Http2SessionPerformanceEntry : public PerformanceEntry {
906
900
double stream_average_duration () const { return stream_average_duration_; }
907
901
nghttp2_session_type type () const { return session_type_; }
908
902
909
- void Notify (Local<Value> obj) {
910
- PerformanceEntry::Notify (env (), kind (), obj);
903
+ void Notify (v8:: Local<v8:: Value> obj) {
904
+ performance:: PerformanceEntry::Notify (env (), kind (), obj);
911
905
}
912
906
913
907
private:
@@ -922,15 +916,17 @@ class Http2SessionPerformanceEntry : public PerformanceEntry {
922
916
nghttp2_session_type session_type_;
923
917
};
924
918
925
- class Http2StreamPerformanceEntry : public PerformanceEntry {
919
+ class Http2StreamPerformanceEntry
920
+ : public performance::PerformanceEntry {
926
921
public:
927
922
Http2StreamPerformanceEntry (
928
923
Environment* env,
929
924
int32_t id,
930
925
const Http2Stream::Statistics& stats) :
931
- PerformanceEntry (env, " Http2Stream" , " http2" ,
932
- stats.start_time,
933
- stats.end_time),
926
+ performance::PerformanceEntry (
927
+ env, " Http2Stream" , " http2" ,
928
+ stats.start_time,
929
+ stats.end_time),
934
930
id_ (id),
935
931
first_header_ (stats.first_header),
936
932
first_byte_ (stats.first_byte),
@@ -945,8 +941,8 @@ class Http2StreamPerformanceEntry : public PerformanceEntry {
945
941
uint64_t sent_bytes () const { return sent_bytes_; }
946
942
uint64_t received_bytes () const { return received_bytes_; }
947
943
948
- void Notify (Local<Value> obj) {
949
- PerformanceEntry::Notify (env (), kind (), obj);
944
+ void Notify (v8:: Local<v8:: Value> obj) {
945
+ performance:: PerformanceEntry::Notify (env (), kind (), obj);
950
946
}
951
947
952
948
private:
@@ -999,7 +995,7 @@ class Http2Session::Http2Settings : public AsyncWrap {
999
995
void Done (bool ack);
1000
996
1001
997
// Returns a Buffer instance with the serialized SETTINGS payload
1002
- Local<Value> Pack ();
998
+ v8:: Local<v8:: Value> Pack ();
1003
999
1004
1000
// Resets the default values in the settings buffer
1005
1001
static void RefreshDefaults (Environment* env);
@@ -1019,9 +1015,9 @@ class Http2Session::Http2Settings : public AsyncWrap {
1019
1015
1020
1016
class Origins {
1021
1017
public:
1022
- Origins (Isolate* isolate,
1023
- Local<Context> context,
1024
- Local<v8::String> origin_string,
1018
+ Origins (v8:: Isolate* isolate,
1019
+ v8:: Local<v8:: Context> context,
1020
+ v8:: Local<v8::String> origin_string,
1025
1021
size_t origin_count);
1026
1022
~Origins () = default ;
1027
1023
0 commit comments