diff options
author | Gabriel Schulhof <gabriel.schulhof@intel.com> | 2018-11-07 07:09:40 -0500 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-11-13 05:27:40 +0100 |
commit | 0603c0a53fc7051260f3f3d3de9582bc3e6af7c9 (patch) | |
tree | eec06e49b87c3f3668c10a2ce6bbb0e55d9a14a7 /src/node_crypto.cc | |
parent | bda4643242159bb74f187614854485d9cfc31bca (diff) | |
download | android-node-v8-0603c0a53fc7051260f3f3d3de9582bc3e6af7c9.tar.gz android-node-v8-0603c0a53fc7051260f3f3d3de9582bc3e6af7c9.tar.bz2 android-node-v8-0603c0a53fc7051260f3f3d3de9582bc3e6af7c9.zip |
src: bundle persistent-to-local methods as class
Create a class `PersistentToLocal` which contains three methods,
`Strong`, `Weak`, and `Default`:
* `Strong` returns a `Local` from a strong persistent reference,
* `Weak` returns a `Local` from a weak persistent reference, and
* `Default` decides based on `IsWeak()` which of the above two to call.
These replace `node::StrongPersistentToLocal()`,
`node::WeakPersistentToLocal()`, and `node::PersistentToLocal()`,
respectively.
PR-URL: https://github.com/nodejs/node/pull/24276
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'src/node_crypto.cc')
-rw-r--r-- | src/node_crypto.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc index d5e0c4f244..3c68aea9bb 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -2348,7 +2348,8 @@ int SSLWrap<Base>::TLSExtStatusCallback(SSL* s, void* arg) { if (w->ocsp_response_.IsEmpty()) return SSL_TLSEXT_ERR_NOACK; - Local<Object> obj = PersistentToLocal(env->isolate(), w->ocsp_response_); + Local<Object> obj = PersistentToLocal::Default(env->isolate(), + w->ocsp_response_); char* resp = Buffer::Data(obj); size_t len = Buffer::Length(obj); |