Index: runtime/include/dart_api.h |
=================================================================== |
--- runtime/include/dart_api.h (revision 22905) |
+++ runtime/include/dart_api.h (working copy) |
@@ -176,9 +176,12 @@ |
* deallocated (see Dart_DeletePersistentHandle). |
*/ |
typedef struct _Dart_Handle* Dart_Handle; |
+typedef struct _Dart_PersistentHandle* Dart_PersistentHandle; |
+typedef struct _Dart_WeakPersistentHandle* Dart_WeakPersistentHandle; |
-typedef void (*Dart_WeakPersistentHandleFinalizer)(Dart_Handle handle, |
- void* peer); |
+typedef void (*Dart_WeakPersistentHandleFinalizer)( |
+ Dart_WeakPersistentHandle handle, |
+ void* peer); |
typedef void (*Dart_PeerFinalizer)(void* peer); |
/** |
@@ -360,6 +363,9 @@ |
*/ |
DART_EXPORT bool Dart_IdentityEquals(Dart_Handle obj1, Dart_Handle obj2); |
+DART_EXPORT Dart_Handle Dart_NewHandleFromPersistent(Dart_PersistentHandle object); |
+DART_EXPORT Dart_Handle Dart_NewHandleFromWeakPersistent(Dart_WeakPersistentHandle object); |
+ |
/** |
* Allocates a persistent handle for an object. |
* |
@@ -368,14 +374,14 @@ |
* |
* Requires there to be a current isolate. |
*/ |
-DART_EXPORT Dart_Handle Dart_NewPersistentHandle(Dart_Handle object); |
+DART_EXPORT Dart_PersistentHandle Dart_NewPersistentHandle(Dart_Handle object); |
/** |
* Deallocates a persistent handle. |
* |
* Requires there to be a current isolate. |
*/ |
-DART_EXPORT void Dart_DeletePersistentHandle(Dart_Handle object); |
+DART_EXPORT void Dart_DeletePersistentHandle(Dart_PersistentHandle object); |
/** |
* Allocates a weak persistent handle for an object. |
@@ -394,17 +400,19 @@ |
* \return Success if the weak persistent handle was |
* created. Otherwise, returns an error. |
*/ |
-DART_EXPORT Dart_Handle Dart_NewWeakPersistentHandle( |
+DART_EXPORT Dart_WeakPersistentHandle Dart_NewWeakPersistentHandle( |
Dart_Handle object, |
void* peer, |
Dart_WeakPersistentHandleFinalizer callback); |
+DART_EXPORT void Dart_DeleteWeakPersistentHandle(Dart_WeakPersistentHandle object); |
+ |
/** |
* Is this object a weak persistent handle? |
* |
* Requires there to be a current isolate. |
*/ |
-DART_EXPORT bool Dart_IsWeakPersistentHandle(Dart_Handle object); |
+DART_EXPORT bool Dart_IsWeakPersistentHandle(Dart_WeakPersistentHandle object); |
/** |
* Allocates a prologue weak persistent handle for an object. |
@@ -432,7 +440,7 @@ |
* \return Success if the prologue weak persistent handle was created. |
* Otherwise, returns an error. |
*/ |
-DART_EXPORT Dart_Handle Dart_NewPrologueWeakPersistentHandle( |
+DART_EXPORT Dart_WeakPersistentHandle Dart_NewPrologueWeakPersistentHandle( |
Dart_Handle object, |
void* peer, |
Dart_WeakPersistentHandleFinalizer callback); |
@@ -442,7 +450,7 @@ |
* |
* Requires there to be a current isolate. |
*/ |
-DART_EXPORT bool Dart_IsPrologueWeakPersistentHandle(Dart_Handle object); |
+DART_EXPORT bool Dart_IsPrologueWeakPersistentHandle(Dart_WeakPersistentHandle object); |
/** |
* Constructs a set of weak references from the Cartesian product of |
@@ -459,10 +467,11 @@ |
* \return Success if the weak reference set could be created. |
* Otherwise, returns an error handle. |
*/ |
-DART_EXPORT Dart_Handle Dart_NewWeakReferenceSet(Dart_Handle* keys, |
- intptr_t num_keys, |
- Dart_Handle* values, |
- intptr_t num_values); |
+DART_EXPORT Dart_Handle Dart_NewWeakReferenceSet( |
+ Dart_WeakPersistentHandle* keys, |
+ intptr_t num_keys, |
+ Dart_WeakPersistentHandle* values, |
+ intptr_t num_values); |
// --- Garbage Collection Callbacks --- |
@@ -1766,12 +1775,9 @@ |
* WeakPersistentHandle which needs to be deleted in the specified callback |
* using Dart_DeletePersistentHandle. |
*/ |
-DART_EXPORT Dart_Handle Dart_NewExternalTypedData( |
- Dart_TypedData_Type type, |
- void* data, |
- intptr_t length, |
- void* peer, |
- Dart_WeakPersistentHandleFinalizer callback); |
+DART_EXPORT Dart_Handle Dart_NewExternalTypedData(Dart_TypedData_Type type, |
+ void* data, |
+ intptr_t length); |
/** |
* Retrieves the peer pointer associated with an external TypedData object. |