src: use DictionaryTemplate for permission diag channel message · nodejs/node@968bdd0 · GitHub
Skip to content

Commit 968bdd0

Browse files
jasnelladuh95
authored andcommitted
src: use DictionaryTemplate for permission diag channel message
Since DiagnosticChannel permission messages always have the same shape and should be as low cost as possible, use a cached DictionaryTemplate for creating them Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #65158 Reviewed-By: Xuguang Mei <meixuguang@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
1 parent f77aa2f commit 968bdd0

4 files changed

Lines changed: 41 additions & 35 deletions

File tree

src/env-inl.h

Lines changed: 4 additions & 6 deletions

src/env.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,9 @@ void IsolateData::DeserializeProperties(const IsolateDataSerializeInfo* info) {
432432
info->primitive_values[i++]); \
433433
Local<String> field; \
434434
if (!maybe_field.ToLocal(&field)) { \
435-
fprintf(stderr, \
436-
"Failed to deserialize " #Name "_permission_string\n"); \
435+
fprintf(stderr, "Failed to deserialize " #Name "_permission_string\n"); \
437436
} \
438-
Name##_permission_string##_.Set(isolate_, field); \
437+
Name##_permission_string##_.Set(isolate_, field); \
439438
} while (0);
440439
PERMISSIONS(V)
441440
#undef V

src/env_properties.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@
460460
V(naptr_record_template, v8::DictionaryTemplate) \
461461
V(object_stats_template, v8::DictionaryTemplate) \
462462
V(page_stats_template, v8::DictionaryTemplate) \
463+
V(permission_diagnostic_channel_message, v8::DictionaryTemplate) \
463464
V(pipe_constructor_template, v8::FunctionTemplate) \
464465
V(script_context_constructor_template, v8::FunctionTemplate) \
465466
V(secure_context_constructor_template, v8::FunctionTemplate) \

src/permission/permission.cc

Lines changed: 34 additions & 26 deletions

0 commit comments

Comments
 (0)