File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ class BaseObject {
4040
4141 inline Environment* env () const ;
4242
43+ // The handle_ must have an internal field count > 0, and the first
44+ // index is reserved for a pointer to this class. This is an
45+ // implicit requirement, but Node does not have a case where it's
46+ // required that MakeWeak() be called and the internal field not
47+ // be set.
4348 template <typename Type>
4449 inline void MakeWeak (Type* ptr);
4550
Original file line number Diff line number Diff line change @@ -120,6 +120,8 @@ class SecureContext : public BaseObject {
120120 }
121121};
122122
123+ // SSLWrap implicitly depends on the inheriting class' handle having an
124+ // internal pointer to the Base class.
123125template <class Base >
124126class SSLWrap {
125127 public:
@@ -217,6 +219,9 @@ class SSLWrap {
217219 friend class SecureContext ;
218220};
219221
222+ // Connection inherits from AsyncWrap because SSLWrap makes calls to
223+ // MakeCallback, but SSLWrap doesn't store the handle itself. Instead it
224+ // assumes that any args.This() called will be the handle from Connection.
220225class Connection : public SSLWrap <Connection>, public AsyncWrap {
221226 public:
222227 ~Connection () {
You can’t perform that action at this time.
0 commit comments