GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — node/src/base-object-inl.h at master · auchenberg/node Expand file tree/ Copy pathbase-object-inl.hMore file actions 75 lines (54 loc) · 1.71 KB / Copy pathbase-object-inl.hFile metadata and controls75 lines (54 loc) · 1.71 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 #ifndef SRC_BASE_OBJECT_INL_H_ #define SRC_BASE_OBJECT_INL_H_ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "base-object.h" #include "env.h" #include "env-inl.h" #include "util.h" #include "util-inl.h" #include "v8.h" namespace node { inline BaseObject::BaseObject(Environment* env, v8::Local<v8::Object> handle) : handle_(env->isolate(), handle), env_(env) { CHECK_EQ(false, handle.IsEmpty()); // The zero field holds a pointer to the handle. Immediately set it to // nullptr in case it's accessed by the user before construction is complete. if (handle->InternalFieldCount() > 0) handle->SetAlignedPointerInInternalField(0, nullptr); } inline BaseObject::~BaseObject() { CHECK(handle_.IsEmpty()); } inline v8::Persistent<v8::Object>& BaseObject::persistent() { return handle_; } inline v8::Local<v8::Object> BaseObject::object() { return PersistentToLocal(env_->isolate(), handle_); } inline Environment* BaseObject::env() const { return env_; } template <typename Type> inline void BaseObject::WeakCallback( const v8::WeakCallbackInfo<Type>& data) { Type* self = data.GetParameter(); self->persistent().Reset(); delete self; } template <typename Type> inline void BaseObject::MakeWeak(Type* ptr) { v8::HandleScope scope(env_->isolate()); v8::Local<v8::Object> handle = object(); CHECK_GT(handle->InternalFieldCount(), 0); Wrap(handle, ptr); handle_.MarkIndependent(); handle_.SetWeak<Type>(ptr, WeakCallback<Type>, v8::WeakCallbackType::kParameter); } inline void BaseObject::ClearWeak() { handle_.ClearWeak(); } } // namespace node #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #endif // SRC_BASE_OBJECT_INL_H_ |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |