Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 826eee3

Browse files
joyeecheungBethGriggs
authored andcommittedSep 21, 2021
src: register external references of PipeWrap for snapshot
PR-URL: #39961 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 7a17cbf commit 826eee3

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed
 

‎src/node_external_reference.h

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class ExternalReferenceRegistry {
7171
V(tty_wrap) \
7272
V(url) \
7373
V(util) \
74+
V(pipe_wrap) \
7475
V(serdes) \
7576
V(string_decoder) \
7677
V(stream_wrap) \

‎src/pipe_wrap.cc

+15-1
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@
2222
#include "pipe_wrap.h"
2323

2424
#include "async_wrap.h"
25+
#include "connect_wrap.h"
2526
#include "connection_wrap.h"
2627
#include "env-inl.h"
2728
#include "handle_wrap.h"
2829
#include "node.h"
2930
#include "node_buffer.h"
30-
#include "connect_wrap.h"
31+
#include "node_external_reference.h"
3132
#include "stream_base-inl.h"
3233
#include "stream_wrap.h"
3334
#include "util-inl.h"
@@ -104,6 +105,17 @@ void PipeWrap::Initialize(Local<Object> target,
104105
constants).Check();
105106
}
106107

108+
void PipeWrap::RegisterExternalReferences(ExternalReferenceRegistry* registry) {
109+
registry->Register(New);
110+
registry->Register(Bind);
111+
registry->Register(Listen);
112+
registry->Register(Connect);
113+
registry->Register(Open);
114+
#ifdef _WIN32
115+
registry->Register(SetPendingInstances);
116+
#endif
117+
registry->Register(Fchmod);
118+
}
107119

108120
void PipeWrap::New(const FunctionCallbackInfo<Value>& args) {
109121
// This constructor should not be exposed to public javascript.
@@ -236,3 +248,5 @@ void PipeWrap::Connect(const FunctionCallbackInfo<Value>& args) {
236248
} // namespace node
237249

238250
NODE_MODULE_CONTEXT_AWARE_INTERNAL(pipe_wrap, node::PipeWrap::Initialize)
251+
NODE_MODULE_EXTERNAL_REFERENCE(pipe_wrap,
252+
node::PipeWrap::RegisterExternalReferences)

‎src/pipe_wrap.h

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
namespace node {
3131

32+
class ExternalReferenceRegistry;
3233
class Environment;
3334

3435
class PipeWrap : public ConnectionWrap<PipeWrap, uv_pipe_t> {
@@ -47,6 +48,7 @@ class PipeWrap : public ConnectionWrap<PipeWrap, uv_pipe_t> {
4748
v8::Local<v8::Context> context,
4849
void* priv);
4950

51+
static void RegisterExternalReferences(ExternalReferenceRegistry* registry);
5052
SET_NO_MEMORY_INFO()
5153
SET_MEMORY_INFO_NAME(PipeWrap)
5254
SET_SELF_SIZE(PipeWrap)

0 commit comments

Comments
 (0)
Please sign in to comment.