summaryrefslogtreecommitdiff
path: root/src/stream_wrap.h
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-01-25 00:43:06 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2018-02-01 10:53:53 +0100
commit5898dc3d0c071a8e5135ba0a80565dd19d49cb32 (patch)
tree8bf1fd4236b183dfd8509b8d5bc43ec7f659f14a /src/stream_wrap.h
parent7c4b09b24bbe7d6a8cbad256f47b30a101a909ea (diff)
downloadnode-new-5898dc3d0c071a8e5135ba0a80565dd19d49cb32.tar.gz
src: simplify handles for libuv streams
Instead of passing along the handle object, just set it as a property on the stream handle object and let the read handler grab it from there. PR-URL: https://github.com/nodejs/node/pull/18334 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'src/stream_wrap.h')
-rw-r--r--src/stream_wrap.h26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/stream_wrap.h b/src/stream_wrap.h
index 129006b160..e5ad25b91e 100644
--- a/src/stream_wrap.h
+++ b/src/stream_wrap.h
@@ -33,9 +33,7 @@
namespace node {
-class LibuvStreamWrap : public HandleWrap,
- public StreamListener,
- public StreamBase {
+class LibuvStreamWrap : public HandleWrap, public StreamBase {
public:
static void Initialize(v8::Local<v8::Object> target,
v8::Local<v8::Value> unused,
@@ -93,30 +91,12 @@ class LibuvStreamWrap : public HandleWrap,
static void SetBlocking(const v8::FunctionCallbackInfo<v8::Value>& args);
// Callbacks for libuv
- static void OnAlloc(uv_handle_t* handle,
- size_t suggested_size,
- uv_buf_t* buf);
+ void OnUvAlloc(size_t suggested_size, uv_buf_t* buf);
+ void OnUvRead(ssize_t nread, const uv_buf_t* buf);
- static void OnRead(uv_stream_t* handle,
- ssize_t nread,
- const uv_buf_t* buf);
static void AfterUvWrite(uv_write_t* req, int status);
static void AfterUvShutdown(uv_shutdown_t* req, int status);
- // Resource interface implementation
- void OnStreamRead(ssize_t nread,
- const uv_buf_t& buf) override {
- CHECK(0 && "must not be called");
- }
- void OnStreamRead(ssize_t nread,
- const uv_buf_t& buf,
- uv_handle_type pending) override;
- void OnStreamAfterWrite(WriteWrap* w, int status) override {
- previous_listener_->OnStreamAfterWrite(w, status);
- }
-
- void AfterWrite(WriteWrap* req_wrap, int status) override;
-
uv_stream_t* const stream_;
};