Skip to content

Commit

Permalink
http2: elevate v8 namespaces of repeated references
Browse files Browse the repository at this point in the history
PR-URL: #24453
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
  • Loading branch information
codegagan authored and codebytere committed Jan 13, 2019
1 parent 4937c92 commit 7041488
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/node_http2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
namespace node {

using v8::ArrayBuffer;
using v8::ArrayBufferCreationMode;
using v8::Boolean;
using v8::Context;
using v8::Float64Array;
using v8::Function;
using v8::Integer;
using v8::NewStringType;
using v8::Number;
using v8::ObjectTemplate;
using v8::String;
Expand Down Expand Up @@ -1411,11 +1413,11 @@ void Http2Session::HandleAltSvcFrame(const nghttp2_frame* frame) {
Integer::New(isolate, id),
String::NewFromOneByte(isolate,
altsvc->origin,
v8::NewStringType::kNormal,
NewStringType::kNormal,
altsvc->origin_len).ToLocalChecked(),
String::NewFromOneByte(isolate,
altsvc->field_value,
v8::NewStringType::kNormal,
NewStringType::kNormal,
altsvc->field_value_len).ToLocalChecked(),
};

Expand Down Expand Up @@ -1445,7 +1447,7 @@ void Http2Session::HandleOriginFrame(const nghttp2_frame* frame) {
argv[j++] =
String::NewFromOneByte(isolate,
entry.origin,
v8::NewStringType::kNormal,
NewStringType::kNormal,
entry.origin_len).ToLocalChecked();
}
if (j > 0)
Expand Down Expand Up @@ -2330,7 +2332,7 @@ void HttpErrorString(const FunctionCallbackInfo<Value>& args) {
String::NewFromOneByte(
env->isolate(),
reinterpret_cast<const uint8_t*>(nghttp2_strerror(val)),
v8::NewStringType::kInternalized).ToLocalChecked());
NewStringType::kInternalized).ToLocalChecked());
}


Expand Down

0 comments on commit 7041488

Please sign in to comment.