Browse Source

src: add comments about implicit dependencies

v0.11.9-release
Trevor Norris 11 years ago
parent
commit
9b4aa355e3
  1. 5
      src/base-object.h
  2. 5
      src/node_crypto.h

5
src/base-object.h

@ -40,6 +40,11 @@ class BaseObject {
inline Environment* env() const;
// The handle_ must have an internal field count > 0, and the first
// index is reserved for a pointer to this class. This is an
// implicit requirement, but Node does not have a case where it's
// required that MakeWeak() be called and the internal field not
// be set.
template <typename Type>
inline void MakeWeak(Type* ptr);

5
src/node_crypto.h

@ -120,6 +120,8 @@ class SecureContext : public BaseObject {
}
};
// SSLWrap implicitly depends on the inheriting class' handle having an
// internal pointer to the Base class.
template <class Base>
class SSLWrap {
public:
@ -217,6 +219,9 @@ class SSLWrap {
friend class SecureContext;
};
// Connection inherits from AsyncWrap because SSLWrap makes calls to
// MakeCallback, but SSLWrap doesn't store the handle itself. Instead it
// assumes that any args.This() called will be the handle from Connection.
class Connection : public SSLWrap<Connection>, public AsyncWrap {
public:
~Connection() {

Loading…
Cancel
Save