@@ -37,17 +37,14 @@ using v8::Value;
37
37
TLSWrap::TLSWrap (Environment* env,
38
38
Kind kind,
39
39
StreamBase* stream,
40
- Handle <Object> stream_obj,
41
- Handle <Object> sc)
42
- : SSLWrap<TLSWrap>(env, Unwrap<SecureContext>(sc), kind),
40
+ SecureContext* sc)
41
+ : SSLWrap<TLSWrap>(env, sc, kind),
43
42
StreamBase (env),
44
43
AsyncWrap (env,
45
44
env->tls_wrap_constructor_function ()->NewInstance(),
46
45
AsyncWrap::PROVIDER_TLSWRAP),
47
- sc_(Unwrap<SecureContext>(sc)),
48
- sc_handle_(env->isolate (), sc),
46
+ sc_(sc),
49
47
stream_(stream),
50
- stream_handle_(env->isolate (), stream_obj),
51
48
enc_in_(nullptr ),
52
49
enc_out_(nullptr ),
53
50
clear_in_(nullptr ),
@@ -84,9 +81,6 @@ TLSWrap::~TLSWrap() {
84
81
clear_in_ = nullptr ;
85
82
86
83
sc_ = nullptr ;
87
- sc_handle_.Reset ();
88
- stream_handle_.Reset ();
89
- persistent ().Reset ();
90
84
91
85
#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
92
86
sni_context_.Reset ();
@@ -196,9 +190,9 @@ void TLSWrap::Wrap(const FunctionCallbackInfo<Value>& args) {
196
190
});
197
191
CHECK_NE (stream, nullptr );
198
192
199
- TLSWrap* res = new TLSWrap (env, kind, stream, stream_obj, sc );
193
+ TLSWrap* res = new TLSWrap (env, kind, stream, Unwrap<SecureContext>(sc) );
200
194
201
- args.GetReturnValue ().Set (res->persistent ());
195
+ args.GetReturnValue ().Set (res->object ());
202
196
}
203
197
204
198
0 commit comments