v8.h | v8.h | |||
---|---|---|---|---|
skipping to change at line 317 | skipping to change at line 317 | |||
} | } | |||
V8_INLINE static Handle<T> New(Isolate* isolate, Handle<T> that) { | V8_INLINE static Handle<T> New(Isolate* isolate, Handle<T> that) { | |||
return New(isolate, that.val_); | return New(isolate, that.val_); | |||
} | } | |||
V8_INLINE static Handle<T> New(Isolate* isolate, | V8_INLINE static Handle<T> New(Isolate* isolate, | |||
const PersistentBase<T>& that) { | const PersistentBase<T>& that) { | |||
return New(isolate, that.val_); | return New(isolate, that.val_); | |||
} | } | |||
#ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR | ||||
private: | ||||
#endif | ||||
/** | ||||
* Creates a new handle for the specified value. | ||||
*/ | ||||
V8_INLINE explicit Handle(T* val) : val_(val) {} | ||||
private: | private: | |||
friend class Utils; | friend class Utils; | |||
template<class F, class M> friend class Persistent; | template<class F, class M> friend class Persistent; | |||
template<class F> friend class PersistentBase; | template<class F> friend class PersistentBase; | |||
template<class F> friend class Handle; | template<class F> friend class Handle; | |||
template<class F> friend class Local; | template<class F> friend class Local; | |||
template<class F> friend class FunctionCallbackInfo; | template<class F> friend class FunctionCallbackInfo; | |||
template<class F> friend class PropertyCallbackInfo; | template<class F> friend class PropertyCallbackInfo; | |||
template<class F> friend class internal::CustomArguments; | template<class F> friend class internal::CustomArguments; | |||
friend Handle<Primitive> Undefined(Isolate* isolate); | friend Handle<Primitive> Undefined(Isolate* isolate); | |||
friend Handle<Primitive> Null(Isolate* isolate); | friend Handle<Primitive> Null(Isolate* isolate); | |||
friend Handle<Boolean> True(Isolate* isolate); | friend Handle<Boolean> True(Isolate* isolate); | |||
friend Handle<Boolean> False(Isolate* isolate); | friend Handle<Boolean> False(Isolate* isolate); | |||
friend class Context; | friend class Context; | |||
friend class HandleScope; | friend class HandleScope; | |||
friend class Object; | friend class Object; | |||
friend class Private; | friend class Private; | |||
/** | ||||
* Creates a new handle for the specified value. | ||||
*/ | ||||
V8_INLINE explicit Handle(T* val) : val_(val) {} | ||||
V8_INLINE static Handle<T> New(Isolate* isolate, T* that); | V8_INLINE static Handle<T> New(Isolate* isolate, T* that); | |||
T* val_; | T* val_; | |||
}; | }; | |||
/** | /** | |||
* A light-weight stack-allocated object handle. All operations | * A light-weight stack-allocated object handle. All operations | |||
* that return objects from within v8 return them in local handles. They | * that return objects from within v8 return them in local handles. They | |||
* are created within HandleScopes, and all local handles allocated within a | * are created within HandleScopes, and all local handles allocated within a | |||
* handle scope are destroyed when the handle scope is destroyed. Hence it | * handle scope are destroyed when the handle scope is destroyed. Hence it | |||
skipping to change at line 395 | skipping to change at line 391 | |||
/** | /** | |||
* Create a local handle for the content of another handle. | * Create a local handle for the content of another handle. | |||
* The referee is kept alive by the local handle even when | * The referee is kept alive by the local handle even when | |||
* the original handle is destroyed/disposed. | * the original handle is destroyed/disposed. | |||
*/ | */ | |||
V8_INLINE static Local<T> New(Isolate* isolate, Handle<T> that); | V8_INLINE static Local<T> New(Isolate* isolate, Handle<T> that); | |||
V8_INLINE static Local<T> New(Isolate* isolate, | V8_INLINE static Local<T> New(Isolate* isolate, | |||
const PersistentBase<T>& that); | const PersistentBase<T>& that); | |||
#ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR | ||||
private: | ||||
#endif | ||||
template <class S> V8_INLINE Local(S* that) : Handle<T>(that) { } | ||||
private: | private: | |||
friend class Utils; | friend class Utils; | |||
template<class F> friend class Eternal; | template<class F> friend class Eternal; | |||
template<class F> friend class PersistentBase; | template<class F> friend class PersistentBase; | |||
template<class F, class M> friend class Persistent; | template<class F, class M> friend class Persistent; | |||
template<class F> friend class Handle; | template<class F> friend class Handle; | |||
template<class F> friend class Local; | template<class F> friend class Local; | |||
template<class F> friend class FunctionCallbackInfo; | template<class F> friend class FunctionCallbackInfo; | |||
template<class F> friend class PropertyCallbackInfo; | template<class F> friend class PropertyCallbackInfo; | |||
friend class String; | friend class String; | |||
friend class Object; | friend class Object; | |||
friend class Context; | friend class Context; | |||
template<class F> friend class internal::CustomArguments; | template<class F> friend class internal::CustomArguments; | |||
friend class HandleScope; | friend class HandleScope; | |||
friend class EscapableHandleScope; | friend class EscapableHandleScope; | |||
template<class F1, class F2, class F3> friend class PersistentValueMap; | template<class F1, class F2, class F3> friend class PersistentValueMap; | |||
template<class F1, class F2> friend class PersistentValueVector; | template<class F1, class F2> friend class PersistentValueVector; | |||
template <class S> V8_INLINE Local(S* that) : Handle<T>(that) { } | ||||
V8_INLINE static Local<T> New(Isolate* isolate, T* that); | V8_INLINE static Local<T> New(Isolate* isolate, T* that); | |||
}; | }; | |||
// Eternal handles are set-once handles that live for the life of the isola te. | // Eternal handles are set-once handles that live for the life of the isola te. | |||
template <class T> class Eternal { | template <class T> class Eternal { | |||
public: | public: | |||
V8_INLINE Eternal() : index_(kInitialValue) { } | V8_INLINE Eternal() : index_(kInitialValue) { } | |||
template<class S> | template<class S> | |||
V8_INLINE Eternal(Isolate* isolate, Local<S> handle) : index_(kInitialVal ue) { | V8_INLINE Eternal(Isolate* isolate, Local<S> handle) : index_(kInitialVal ue) { | |||
Set(isolate, handle); | Set(isolate, handle); | |||
skipping to change at line 722 | skipping to change at line 713 | |||
} | } | |||
// TODO(dcarney): this is pretty useless, fix or remove | // TODO(dcarney): this is pretty useless, fix or remove | |||
template <class S> V8_INLINE Persistent<S>& As() { // NOLINT | template <class S> V8_INLINE Persistent<S>& As() { // NOLINT | |||
return Persistent<S>::Cast(*this); | return Persistent<S>::Cast(*this); | |||
} | } | |||
// This will be removed. | // This will be removed. | |||
V8_INLINE T* ClearAndLeak(); | V8_INLINE T* ClearAndLeak(); | |||
// TODO(dcarney): remove | ||||
#ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR | ||||
private: | ||||
#endif | ||||
template <class S> V8_INLINE Persistent(S* that) : PersistentBase<T>(that | ||||
) { } | ||||
V8_INLINE T* operator*() const { return this->val_; } | ||||
private: | private: | |||
friend class Isolate; | friend class Isolate; | |||
friend class Utils; | friend class Utils; | |||
template<class F> friend class Handle; | template<class F> friend class Handle; | |||
template<class F> friend class Local; | template<class F> friend class Local; | |||
template<class F1, class F2> friend class Persistent; | template<class F1, class F2> friend class Persistent; | |||
template<class F> friend class ReturnValue; | template<class F> friend class ReturnValue; | |||
template <class S> V8_INLINE Persistent(S* that) : PersistentBase<T>(that | ||||
) { } | ||||
V8_INLINE T* operator*() const { return this->val_; } | ||||
template<class S, class M2> | template<class S, class M2> | |||
V8_INLINE void Copy(const Persistent<S, M2>& that); | V8_INLINE void Copy(const Persistent<S, M2>& that); | |||
}; | }; | |||
/** | /** | |||
* A PersistentBase which has move semantics. | * A PersistentBase which has move semantics. | |||
* | * | |||
* Note: Persistent class hierarchy is subject to future changes. | * Note: Persistent class hierarchy is subject to future changes. | |||
*/ | */ | |||
template<class T> | template<class T> | |||
End of changes. 6 change blocks. | ||||
25 lines changed or deleted | 9 lines changed or added | |||