Skip to content

Commit 454883b

Browse files
codegaganrvagg
authored andcommitted
http2: elevate v8 namespaces of repeated references
PR-URL: #24453 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent f112c06 commit 454883b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/node_http2.cc

+7-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212
namespace node {
1313

1414
using v8::ArrayBuffer;
15+
using v8::ArrayBufferCreationMode;
1516
using v8::Boolean;
1617
using v8::Context;
1718
using v8::Float64Array;
1819
using v8::Function;
1920
using v8::Integer;
21+
using v8::NewStringType;
2022
using v8::Number;
2123
using v8::ObjectTemplate;
2224
using v8::String;
@@ -1401,11 +1403,11 @@ void Http2Session::HandleAltSvcFrame(const nghttp2_frame* frame) {
14011403
Integer::New(isolate, id),
14021404
String::NewFromOneByte(isolate,
14031405
altsvc->origin,
1404-
v8::NewStringType::kNormal,
1406+
NewStringType::kNormal,
14051407
altsvc->origin_len).ToLocalChecked(),
14061408
String::NewFromOneByte(isolate,
14071409
altsvc->field_value,
1408-
v8::NewStringType::kNormal,
1410+
NewStringType::kNormal,
14091411
altsvc->field_value_len).ToLocalChecked(),
14101412
};
14111413

@@ -1430,7 +1432,7 @@ void Http2Session::HandleOriginFrame(const nghttp2_frame* frame) {
14301432
const nghttp2_origin_entry& entry = origin->ov[i];
14311433
origin_v[i] =
14321434
String::NewFromOneByte(
1433-
isolate, entry.origin, v8::NewStringType::kNormal, entry.origin_len)
1435+
isolate, entry.origin, NewStringType::kNormal, entry.origin_len)
14341436
.ToLocalChecked();
14351437
}
14361438
Local<Value> holder = Array::New(isolate, origin_v.data(), origin_v.size());
@@ -1813,7 +1815,7 @@ void Http2Session::OnStreamRead(ssize_t nread, const uv_buf_t& buf) {
18131815
ArrayBuffer::New(isolate,
18141816
buf.base,
18151817
nread,
1816-
v8::ArrayBufferCreationMode::kInternalized);
1818+
ArrayBufferCreationMode::kInternalized);
18171819

18181820
statistics_.data_received += nread;
18191821
ssize_t ret = Write(&stream_buf_, 1);
@@ -2316,7 +2318,7 @@ void HttpErrorString(const FunctionCallbackInfo<Value>& args) {
23162318
String::NewFromOneByte(
23172319
env->isolate(),
23182320
reinterpret_cast<const uint8_t*>(nghttp2_strerror(val)),
2319-
v8::NewStringType::kInternalized).ToLocalChecked());
2321+
NewStringType::kInternalized).ToLocalChecked());
23202322
}
23212323

23222324

0 commit comments

Comments
 (0)