Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ad6dee3
src: extracting OnConnection from pipe_wrap and tcp_wrap
danbev Jul 4, 2016
a3b976e
Moving template types to the ConnectionWrap class.
danbev Jul 7, 2016
34d5abc
extracting UVHandle() and handle_ to ConnectionWrap.
danbev Jul 8, 2016
564342d
Renaming BaseObject's handle_ to objecthandle_
danbev Jul 9, 2016
623ad2e
Changing uvhandle_ back to handle_
danbev Jul 9, 2016
458accc
Removing unnecessary friend class ConnectionWrap
danbev Jul 9, 2016
ee0f2b9
Making UVHandle() an inline member function.
danbev Jul 9, 2016
5562c45
Adding a space after template keyword
danbev Jul 9, 2016
ee62109
Correcting comment changing Instanciate to Instantiate
danbev Jul 9, 2016
579f48a
Adding a null pointer check for wrap_data.
danbev Jul 9, 2016
1437ec6
Adding back spaces to line up macro continuation escape charaters
danbev Jul 9, 2016
d0da4bc
Removing unnecessary template specializations
danbev Jul 9, 2016
1b3be60
Fixing typo in comment.
danbev Jul 9, 2016
e364ec4
Lining up arguments for SetWeak method call
danbev Jul 14, 2016
e8ed621
Renaming objecthandle_ to persistent_handle_
danbev Jul 14, 2016
7ce112a
Adding a comment to clarify uv_accept error handling
danbev Jul 14, 2016
c9ec24d
Correcting spelling of unavailable.
danbev Jul 14, 2016
5ef85f9
Removing multiple inheritance.
danbev Jul 14, 2016
ece2d31
Making ConnectionWrap inherit from StreamWrap
danbev Jul 16, 2016
73c956d
Adding a destructor for ConnectionWrap
danbev Jul 17, 2016
4feb84a
Removing unnecessary template parameters for OnConnection
danbev Jul 17, 2016
0a1ff38
Removing the inclusion of async-wrap.h
danbev Jul 17, 2016
85af1a6
Removing the empty destructor in favour of an explicit default
danbev Jul 20, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removing multiple inheritance.
  • Loading branch information
danbev committed Jul 14, 2016
commit 5ef85f9eb2eb125cf65adf57ced3a7f3ee61e886
6 changes: 0 additions & 6 deletions src/connection_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ namespace node {
template <typename WrapType, typename UVType>
class ConnectionWrap {
public:
UVType* UVHandle() {
return &handle_;
}

protected:
static void OnConnection(uv_stream_t* handle, int status);
UVType handle_;
};


Expand Down
2 changes: 1 addition & 1 deletion src/pipe_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void PipeWrap::Listen(const FunctionCallbackInfo<Value>& args) {
int backlog = args[0]->Int32Value();
int err = uv_listen(reinterpret_cast<uv_stream_t*>(&wrap->handle_),
backlog,
OnConnection);
ConnectionWrap<PipeWrap, uv_pipe_t>::OnConnection);
args.GetReturnValue().Set(err);
}

Expand Down
8 changes: 7 additions & 1 deletion src/pipe_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@

namespace node {

class PipeWrap : public StreamWrap, public ConnectionWrap<PipeWrap, uv_pipe_t> {
class PipeWrap : public StreamWrap {
public:
uv_pipe_t* UVHandle() {
return &handle_;
}
static v8::Local<v8::Object> Instantiate(Environment* env, AsyncWrap* parent);
static void Initialize(v8::Local<v8::Object> target,
v8::Local<v8::Value> unused,
Expand All @@ -20,6 +23,7 @@ class PipeWrap : public StreamWrap, public ConnectionWrap<PipeWrap, uv_pipe_t> {
size_t self_size() const override { return sizeof(*this); }

private:
friend class ConnectionWrap<PipeWrap, uv_pipe_t>;
PipeWrap(Environment* env,
v8::Local<v8::Object> object,
bool ipc,
Expand All @@ -37,6 +41,8 @@ class PipeWrap : public StreamWrap, public ConnectionWrap<PipeWrap, uv_pipe_t> {
#endif

static void AfterConnect(uv_connect_t* req, int status);

uv_pipe_t handle_;
};


Expand Down
2 changes: 1 addition & 1 deletion src/tcp_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ void TCPWrap::Listen(const FunctionCallbackInfo<Value>& args) {
int backlog = args[0]->Int32Value();
int err = uv_listen(reinterpret_cast<uv_stream_t*>(&wrap->handle_),
backlog,
OnConnection);
ConnectionWrap<TCPWrap, uv_tcp_t>::OnConnection);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also no longer necessary, I think

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, let me remove those parameters.

args.GetReturnValue().Set(err);
}

Expand Down
8 changes: 7 additions & 1 deletion src/tcp_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@

namespace node {

class TCPWrap : public StreamWrap, public ConnectionWrap<TCPWrap, uv_tcp_t> {
class TCPWrap : public StreamWrap {
public:
uv_tcp_t* UVHandle() {
return &handle_;
}
static v8::Local<v8::Object> Instantiate(Environment* env, AsyncWrap* parent);
static void Initialize(v8::Local<v8::Object> target,
v8::Local<v8::Value> unused,
Expand All @@ -20,6 +23,7 @@ class TCPWrap : public StreamWrap, public ConnectionWrap<TCPWrap, uv_tcp_t> {
size_t self_size() const override { return sizeof(*this); }

private:
friend class ConnectionWrap<TCPWrap, uv_tcp_t>;
typedef uv_tcp_t HandleType;

template <typename T,
Expand All @@ -45,6 +49,8 @@ class TCPWrap : public StreamWrap, public ConnectionWrap<TCPWrap, uv_tcp_t> {
#endif

static void AfterConnect(uv_connect_t* req, int status);

uv_tcp_t handle_;
};


Expand Down