summaryrefslogtreecommitdiff
path: root/src/tls_wrap.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-09-25 12:57:03 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-09-25 19:44:53 +0200
commitc79d5163e530892c62b08d8b814b588220c26ec8 (patch)
tree771823ddf0dac11efe378f8ddc6ddcd0e756a0f0 /src/tls_wrap.cc
parent42af62f33adda57d8913768d939c1f4d0f8fe5a3 (diff)
downloadnode-new-c79d5163e530892c62b08d8b814b588220c26ec8.tar.gz
src: remove ObjectWrap dependency from core
Drop the ObjectWrap dependency in favor of an internal WeakObject class. Let's us stop worrying about API and ABI compatibility when making changes to the way node.js deals with weakly persistent handles internally.
Diffstat (limited to 'src/tls_wrap.cc')
-rw-r--r--src/tls_wrap.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc
index e6afda6c0c..a0eea75c63 100644
--- a/src/tls_wrap.cc
+++ b/src/tls_wrap.cc
@@ -58,7 +58,7 @@ TLSCallbacks::TLSCallbacks(Environment* env,
Kind kind,
Handle<Object> sc,
StreamWrapCallbacks* old)
- : SSLWrap<TLSCallbacks>(env, ObjectWrap::Unwrap<SecureContext>(sc), kind),
+ : SSLWrap<TLSCallbacks>(env, WeakObject::Unwrap<SecureContext>(sc), kind),
StreamWrapCallbacks(old),
enc_in_(NULL),
enc_out_(NULL),
@@ -70,7 +70,7 @@ TLSCallbacks::TLSCallbacks(Environment* env,
shutdown_(false) {
// Persist SecureContext
- sc_ = ObjectWrap::Unwrap<SecureContext>(sc);
+ sc_ = WeakObject::Unwrap<SecureContext>(sc);
sc_handle_.Reset(node_isolate, sc);
Local<Object> object = env->tls_wrap_constructor_function()->NewInstance();
@@ -236,7 +236,7 @@ void TLSCallbacks::SSLInfoCallback(const SSL* ssl_, int where, int ret) {
// There should be a Context::Scope a few stack frames down.
assert(env->context() == env->isolate()->GetCurrentContext());
HandleScope handle_scope(env->isolate());
- Local<Object> object = c->object(env->isolate());
+ Local<Object> object = c->weak_object(env->isolate());
if (where & SSL_CB_HANDSHAKE_START) {
Local<Value> callback = object->Get(env->onhandshakestart_string());
@@ -313,7 +313,7 @@ void TLSCallbacks::EncOutCb(uv_write_t* req, int status) {
FIXED_ONE_BYTE_STRING(node_isolate, "write cb error, status: "),
Integer::New(status, node_isolate)->ToString());
MakeCallback(env,
- callbacks->object(node_isolate),
+ callbacks->weak_object(node_isolate),
env->onerror_string(),
1,
&arg);
@@ -398,7 +398,7 @@ void TLSCallbacks::ClearOut() {
if (!argv.IsEmpty()) {
MakeCallback(env(),
- object(node_isolate),
+ weak_object(node_isolate),
env()->onerror_string(),
1,
&argv);
@@ -437,7 +437,7 @@ bool TLSCallbacks::ClearIn() {
Handle<Value> argv = GetSSLError(written, &err);
if (!argv.IsEmpty()) {
MakeCallback(env(),
- object(node_isolate),
+ weak_object(node_isolate),
env()->onerror_string(),
1,
&argv);
@@ -504,7 +504,7 @@ int TLSCallbacks::DoWrite(WriteWrap* w,
Handle<Value> argv = GetSSLError(written, &err);
if (!argv.IsEmpty()) {
MakeCallback(env(),
- object(node_isolate),
+ weak_object(node_isolate),
env()->onerror_string(),
1,
&argv);
@@ -688,7 +688,7 @@ int TLSCallbacks::SelectSNIContextCallback(SSL* s, int* ad, void* arg) {
if (servername != NULL) {
// Call the SNI callback and use its return value as context
- Local<Object> object = p->object(node_isolate);
+ Local<Object> object = p->weak_object(node_isolate);
Local<Value> ctx = object->Get(env->sni_context_string());
if (!ctx->IsObject())
@@ -697,7 +697,7 @@ int TLSCallbacks::SelectSNIContextCallback(SSL* s, int* ad, void* arg) {
p->sni_context_.Dispose();
p->sni_context_.Reset(node_isolate, ctx);
- SecureContext* sc = ObjectWrap::Unwrap<SecureContext>(ctx.As<Object>());
+ SecureContext* sc = WeakObject::Unwrap<SecureContext>(ctx.As<Object>());
SSL_set_SSL_CTX(s, sc->ctx_);
}