aboutsummaryrefslogtreecommitdiff
path: root/src/node_zlib.cc
diff options
context:
space:
mode:
authorTrevor Norris <trev.norris@gmail.com>2013-11-04 10:49:55 -0800
committerTrevor Norris <trev.norris@gmail.com>2013-11-12 13:38:31 -0800
commitd120d92bfef0b5012e76c636335fee80e9c1e4a9 (patch)
tree277864e238d78271c82b3e77c8f3e8c850c35bd9 /src/node_zlib.cc
parent6cea16f2c9ec0666708e924fa93c664ddb000b5c (diff)
downloadandroid-node-v8-d120d92bfef0b5012e76c636335fee80e9c1e4a9.tar.gz
android-node-v8-d120d92bfef0b5012e76c636335fee80e9c1e4a9.tar.bz2
android-node-v8-d120d92bfef0b5012e76c636335fee80e9c1e4a9.zip
base-object: add BaseObject
BaseObject is a class that just handles the Persistent handle attached to the class instance. This also removed WeakObject. Reordering the inheritance chain helps prevent unneeded calls on instances that don't call MakeCallback.
Diffstat (limited to 'src/node_zlib.cc')
-rw-r--r--src/node_zlib.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/node_zlib.cc b/src/node_zlib.cc
index c4da32e266..f3da76c37d 100644
--- a/src/node_zlib.cc
+++ b/src/node_zlib.cc
@@ -22,12 +22,12 @@
#include "node.h"
#include "node_buffer.h"
+#include "async-wrap.h"
+#include "async-wrap-inl.h"
#include "env.h"
#include "env-inl.h"
#include "util.h"
#include "util-inl.h"
-#include "weak-object.h"
-#include "weak-object-inl.h"
#include "v8.h"
#include "zlib.h"
@@ -69,11 +69,11 @@ void InitZlib(v8::Handle<v8::Object> target);
/**
* Deflate/Inflate
*/
-class ZCtx : public WeakObject {
+class ZCtx : public AsyncWrap {
public:
ZCtx(Environment* env, Local<Object> wrap, node_zlib_mode mode)
- : WeakObject(env, wrap),
+ : AsyncWrap(env, wrap),
chunk_size_(0),
dictionary_(NULL),
dictionary_len_(0),
@@ -87,6 +87,7 @@ class ZCtx : public WeakObject {
windowBits_(0),
write_in_progress_(false),
refs_(0) {
+ MakeWeak<ZCtx>(this);
}
@@ -522,7 +523,7 @@ class ZCtx : public WeakObject {
void Unref() {
assert(refs_ > 0);
if (--refs_ == 0) {
- MakeWeak();
+ MakeWeak<ZCtx>(this);
}
}