@@ -54,9 +54,9 @@ using v8::Object;
5454using v8::Value;
5555
5656
57- void StreamWrap ::Initialize (Local<Object> target,
58- Local<Value> unused,
59- Local<Context> context) {
57+ void LibuvStreamWrap ::Initialize (Local<Object> target,
58+ Local<Value> unused,
59+ Local<Context> context) {
6060 Environment* env = Environment::GetCurrent (context);
6161
6262 auto is_construct_call_callback =
@@ -85,10 +85,10 @@ void StreamWrap::Initialize(Local<Object> target,
8585}
8686
8787
88- StreamWrap::StreamWrap (Environment* env,
89- Local<Object> object,
90- uv_stream_t * stream,
91- AsyncWrap::ProviderType provider)
88+ LibuvStreamWrap::LibuvStreamWrap (Environment* env,
89+ Local<Object> object,
90+ uv_stream_t * stream,
91+ AsyncWrap::ProviderType provider)
9292 : HandleWrap(env,
9393 object,
9494 reinterpret_cast <uv_handle_t *>(stream),
@@ -101,15 +101,15 @@ StreamWrap::StreamWrap(Environment* env,
101101}
102102
103103
104- void StreamWrap ::AddMethods (Environment* env,
105- v8::Local<v8::FunctionTemplate> target,
106- int flags) {
104+ void LibuvStreamWrap ::AddMethods (Environment* env,
105+ v8::Local<v8::FunctionTemplate> target,
106+ int flags) {
107107 env->SetProtoMethod (target, " setBlocking" , SetBlocking);
108- StreamBase::AddMethods<StreamWrap >(env, target, flags);
108+ StreamBase::AddMethods<LibuvStreamWrap >(env, target, flags);
109109}
110110
111111
112- int StreamWrap ::GetFD () {
112+ int LibuvStreamWrap ::GetFD () {
113113 int fd = -1 ;
114114#if !defined(_WIN32)
115115 if (stream () != nullptr )
@@ -119,53 +119,53 @@ int StreamWrap::GetFD() {
119119}
120120
121121
122- bool StreamWrap ::IsAlive () {
122+ bool LibuvStreamWrap ::IsAlive () {
123123 return HandleWrap::IsAlive (this );
124124}
125125
126126
127- bool StreamWrap ::IsClosing () {
127+ bool LibuvStreamWrap ::IsClosing () {
128128 return uv_is_closing (reinterpret_cast <uv_handle_t *>(stream ()));
129129}
130130
131131
132- void * StreamWrap ::Cast () {
132+ void * LibuvStreamWrap ::Cast () {
133133 return reinterpret_cast <void *>(this );
134134}
135135
136136
137- AsyncWrap* StreamWrap ::GetAsyncWrap () {
137+ AsyncWrap* LibuvStreamWrap ::GetAsyncWrap () {
138138 return static_cast <AsyncWrap*>(this );
139139}
140140
141141
142- bool StreamWrap ::IsIPCPipe () {
142+ bool LibuvStreamWrap ::IsIPCPipe () {
143143 return is_named_pipe_ipc ();
144144}
145145
146146
147- void StreamWrap ::UpdateWriteQueueSize () {
147+ void LibuvStreamWrap ::UpdateWriteQueueSize () {
148148 HandleScope scope (env ()->isolate ());
149149 Local<Integer> write_queue_size =
150150 Integer::NewFromUnsigned (env ()->isolate (), stream ()->write_queue_size );
151151 object ()->Set (env ()->write_queue_size_string (), write_queue_size);
152152}
153153
154154
155- int StreamWrap ::ReadStart () {
155+ int LibuvStreamWrap ::ReadStart () {
156156 return uv_read_start (stream (), OnAlloc, OnRead);
157157}
158158
159159
160- int StreamWrap ::ReadStop () {
160+ int LibuvStreamWrap ::ReadStop () {
161161 return uv_read_stop (stream ());
162162}
163163
164164
165- void StreamWrap ::OnAlloc (uv_handle_t * handle,
165+ void LibuvStreamWrap ::OnAlloc (uv_handle_t * handle,
166166 size_t suggested_size,
167167 uv_buf_t * buf) {
168- StreamWrap * wrap = static_cast <StreamWrap *>(handle->data );
168+ LibuvStreamWrap * wrap = static_cast <LibuvStreamWrap *>(handle->data );
169169 HandleScope scope (wrap->env ()->isolate ());
170170 Context::Scope context_scope (wrap->env ()->context ());
171171
@@ -175,14 +175,14 @@ void StreamWrap::OnAlloc(uv_handle_t* handle,
175175}
176176
177177
178- void StreamWrap ::OnAllocImpl (size_t size, uv_buf_t * buf, void * ctx) {
178+ void LibuvStreamWrap ::OnAllocImpl (size_t size, uv_buf_t * buf, void * ctx) {
179179 buf->base = node::Malloc (size);
180180 buf->len = size;
181181}
182182
183183
184184template <class WrapType , class UVType >
185- static Local<Object> AcceptHandle (Environment* env, StreamWrap * parent) {
185+ static Local<Object> AcceptHandle (Environment* env, LibuvStreamWrap * parent) {
186186 EscapableHandleScope scope (env->isolate ());
187187 Local<Object> wrap_obj;
188188 UVType* handle;
@@ -202,11 +202,11 @@ static Local<Object> AcceptHandle(Environment* env, StreamWrap* parent) {
202202}
203203
204204
205- void StreamWrap ::OnReadImpl (ssize_t nread,
205+ void LibuvStreamWrap ::OnReadImpl (ssize_t nread,
206206 const uv_buf_t * buf,
207207 uv_handle_type pending,
208208 void * ctx) {
209- StreamWrap * wrap = static_cast <StreamWrap *>(ctx);
209+ LibuvStreamWrap * wrap = static_cast <LibuvStreamWrap *>(ctx);
210210 Environment* env = wrap->env ();
211211 HandleScope handle_scope (env->isolate ());
212212 Context::Scope context_scope (env->context ());
@@ -244,10 +244,10 @@ void StreamWrap::OnReadImpl(ssize_t nread,
244244}
245245
246246
247- void StreamWrap ::OnRead (uv_stream_t * handle,
247+ void LibuvStreamWrap ::OnRead (uv_stream_t * handle,
248248 ssize_t nread,
249249 const uv_buf_t * buf) {
250- StreamWrap * wrap = static_cast <StreamWrap *>(handle->data );
250+ LibuvStreamWrap * wrap = static_cast <LibuvStreamWrap *>(handle->data );
251251 HandleScope scope (wrap->env ()->isolate ());
252252 Context::Scope context_scope (wrap->env ()->context ());
253253 uv_handle_type type = UV_UNKNOWN_HANDLE;
@@ -273,8 +273,8 @@ void StreamWrap::OnRead(uv_stream_t* handle,
273273}
274274
275275
276- void StreamWrap ::SetBlocking (const FunctionCallbackInfo<Value>& args) {
277- StreamWrap * wrap;
276+ void LibuvStreamWrap ::SetBlocking (const FunctionCallbackInfo<Value>& args) {
277+ LibuvStreamWrap * wrap;
278278 ASSIGN_OR_RETURN_UNWRAP (&wrap, args.Holder ());
279279
280280 CHECK_GT (args.Length (), 0 );
@@ -286,15 +286,15 @@ void StreamWrap::SetBlocking(const FunctionCallbackInfo<Value>& args) {
286286}
287287
288288
289- int StreamWrap ::DoShutdown (ShutdownWrap* req_wrap) {
289+ int LibuvStreamWrap ::DoShutdown (ShutdownWrap* req_wrap) {
290290 int err;
291291 err = uv_shutdown (req_wrap->req (), stream (), AfterShutdown);
292292 req_wrap->Dispatched ();
293293 return err;
294294}
295295
296296
297- void StreamWrap ::AfterShutdown (uv_shutdown_t * req, int status) {
297+ void LibuvStreamWrap ::AfterShutdown (uv_shutdown_t * req, int status) {
298298 ShutdownWrap* req_wrap = ShutdownWrap::from_req (req);
299299 CHECK_NE (req_wrap, nullptr );
300300 HandleScope scope (req_wrap->env ()->isolate ());
@@ -307,7 +307,7 @@ void StreamWrap::AfterShutdown(uv_shutdown_t* req, int status) {
307307// values, shifting their base and decrementing their length. This is
308308// required in order to skip the data that was successfully written via
309309// uv_try_write().
310- int StreamWrap ::DoTryWrite (uv_buf_t ** bufs, size_t * count) {
310+ int LibuvStreamWrap ::DoTryWrite (uv_buf_t ** bufs, size_t * count) {
311311 int err;
312312 size_t written;
313313 uv_buf_t * vbufs = *bufs;
@@ -343,7 +343,7 @@ int StreamWrap::DoTryWrite(uv_buf_t** bufs, size_t* count) {
343343}
344344
345345
346- int StreamWrap ::DoWrite (WriteWrap* w,
346+ int LibuvStreamWrap ::DoWrite (WriteWrap* w,
347347 uv_buf_t * bufs,
348348 size_t count,
349349 uv_stream_t * send_handle) {
@@ -372,7 +372,7 @@ int StreamWrap::DoWrite(WriteWrap* w,
372372}
373373
374374
375- void StreamWrap ::AfterWrite (uv_write_t * req, int status) {
375+ void LibuvStreamWrap ::AfterWrite (uv_write_t * req, int status) {
376376 WriteWrap* req_wrap = WriteWrap::from_req (req);
377377 CHECK_NE (req_wrap, nullptr );
378378 HandleScope scope (req_wrap->env ()->isolate ());
@@ -381,11 +381,12 @@ void StreamWrap::AfterWrite(uv_write_t* req, int status) {
381381}
382382
383383
384- void StreamWrap ::OnAfterWriteImpl (WriteWrap* w, void * ctx) {
385- StreamWrap * wrap = static_cast <StreamWrap *>(ctx);
384+ void LibuvStreamWrap ::OnAfterWriteImpl (WriteWrap* w, void * ctx) {
385+ LibuvStreamWrap * wrap = static_cast <LibuvStreamWrap *>(ctx);
386386 wrap->UpdateWriteQueueSize ();
387387}
388388
389389} // namespace node
390390
391- NODE_MODULE_CONTEXT_AWARE_BUILTIN (stream_wrap, node::StreamWrap::Initialize)
391+ NODE_MODULE_CONTEXT_AWARE_BUILTIN (stream_wrap,
392+ node::LibuvStreamWrap::Initialize)
0 commit comments