Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Unified Diff: include/v8.h

Issue 11360082: Pass Isolate to MakeWeak(), IsWeak(), and AddObjectGroup(). (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 65d302e7bd1f0fa607c551a41b4d3b7d664a52a1..c2f7d3da77c90889a2e784465a61a03ea04cff7c 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -389,6 +389,8 @@ template <class T> class Persistent : public Handle<T> {
* it the object reference and the given parameters.
*/
inline void MakeWeak(void* parameters, WeakReferenceCallback callback);
+ inline void MakeWeak(Isolate* isolate, void* parameters,
+ WeakReferenceCallback callback);
/** Clears the weak reference to this object. */
inline void ClearWeak();
@@ -410,6 +412,7 @@ template <class T> class Persistent : public Handle<T> {
/** Returns true if the handle's reference is weak. */
inline bool IsWeak() const;
+ inline bool IsWeak(Isolate* isolate) const;
/**
* Assigns a wrapper class ID to the handle. See RetainedObjectInfo
@@ -3260,6 +3263,10 @@ class V8EXPORT V8 {
static void AddObjectGroup(Persistent<Value>* objects,
size_t length,
RetainedObjectInfo* info = NULL);
+ static void AddObjectGroup(Isolate* isolate,
+ Persistent<Value>* objects,
+ size_t length,
+ RetainedObjectInfo* info = NULL);
/**
* Allows the host application to declare implicit references between
@@ -3491,11 +3498,17 @@ class V8EXPORT V8 {
static void MakeWeak(internal::Object** global_handle,
void* data,
WeakReferenceCallback);
+ static void MakeWeak(internal::Isolate* isolate,
+ internal::Object** global_handle,
+ void* data,
+ WeakReferenceCallback);
static void ClearWeak(internal::Object** global_handle);
static void MarkIndependent(internal::Object** global_handle);
static bool IsGlobalIndependent(internal::Object** global_handle);
static bool IsGlobalNearDeath(internal::Object** global_handle);
static bool IsGlobalWeak(internal::Object** global_handle);
+ static bool IsGlobalWeak(internal::Isolate* isolate,
+ internal::Object** global_handle);
static void SetWrapperClassId(internal::Object** global_handle,
uint16_t class_id);
static uint16_t GetWrapperClassId(internal::Object** global_handle);
@@ -4237,6 +4250,14 @@ bool Persistent<T>::IsWeak() const {
template <class T>
+bool Persistent<T>::IsWeak(Isolate* isolate) const {
+ if (this->IsEmpty()) return false;
+ return V8::IsGlobalWeak(reinterpret_cast<internal::Isolate*>(isolate),
+ reinterpret_cast<internal::Object**>(**this));
+}
+
+
+template <class T>
void Persistent<T>::Dispose() {
if (this->IsEmpty()) return;
V8::DisposeGlobal(reinterpret_cast<internal::Object**>(**this));
@@ -4254,6 +4275,15 @@ void Persistent<T>::MakeWeak(void* parameters, WeakReferenceCallback callback) {
}
template <class T>
+void Persistent<T>::MakeWeak(Isolate* isolate, void* parameters,
+ WeakReferenceCallback callback) {
+ V8::MakeWeak(reinterpret_cast<internal::Isolate*>(isolate),
+ reinterpret_cast<internal::Object**>(**this),
+ parameters,
+ callback);
+}
+
+template <class T>
void Persistent<T>::ClearWeak() {
V8::ClearWeak(reinterpret_cast<internal::Object**>(**this));
}
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698