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

Unified Diff: include/v8.h

Issue 11959031: Add a new weak handle callback that passes an Isolate to an embedder (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Applied sven's comments Created 7 years, 11 months 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 e5af0dd65f77f7d1192ca2c860d6c3464d6e7c95..6c6e71ed1611f8f36acc99d9303a6576529cde8e 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -151,11 +151,17 @@ class Isolate;
* This callback should either explicitly invoke Dispose on |object| if
* V8 wrapper is not needed anymore, or 'revive' it by invocation of MakeWeak.
*
+ * \param isolate the current isolate
* \param object the weak global object to be reclaimed by the garbage collector
* \param parameter the value passed in when making the weak global object
+ *
+ * WeakReferenceCallback is deprecated. Use WeakHandleCallback instead.
*/
typedef void (*WeakReferenceCallback)(Persistent<Value> object,
void* parameter);
+typedef void (*WeakHandleCallback)(Isolate* isolate,
+ Persistent<Value> object,
+ void* parameter);
// --- Handles ---
@@ -409,11 +415,12 @@ template <class T> class Persistent : public Handle<T> {
* refer to the object, the garbage collector will perform a
* callback to the given V8::WeakReferenceCallback function, passing
* it the object reference and the given parameters.
+ * The 2-arg MakeWeak is deprecated. The 3-arg MakeWeak should be used.
*/
V8_INLINE(void MakeWeak(void* parameters, WeakReferenceCallback callback));
V8_INLINE(void MakeWeak(Isolate* isolate,
void* parameters,
- WeakReferenceCallback callback));
+ WeakHandleCallback callback));
/** Clears the weak reference to this object. */
V8_INLINE(void ClearWeak());
@@ -3529,7 +3536,7 @@ class V8EXPORT V8 {
static void MakeWeak(internal::Isolate* isolate,
internal::Object** global_handle,
void* data,
- WeakReferenceCallback);
+ WeakHandleCallback);
static void ClearWeak(internal::Object** global_handle);
static void MarkIndependent(internal::Object** global_handle);
static void MarkIndependent(internal::Isolate* isolate,
@@ -4376,7 +4383,7 @@ void Persistent<T>::MakeWeak(void* parameters, WeakReferenceCallback callback) {
template <class T>
void Persistent<T>::MakeWeak(Isolate* isolate, void* parameters,
- WeakReferenceCallback callback) {
+ WeakHandleCallback callback) {
V8::MakeWeak(reinterpret_cast<internal::Isolate*>(isolate),
reinterpret_cast<internal::Object**>(**this),
parameters,
« 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