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

Unified Diff: runtime/vm/dart_api_impl.h

Issue 15772005: - Add different types for persistent and weak persistent handles (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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
Index: runtime/vm/dart_api_impl.h
===================================================================
--- runtime/vm/dart_api_impl.h (revision 22905)
+++ runtime/vm/dart_api_impl.h (working copy)
@@ -80,18 +80,18 @@
// Validates and converts the passed in handle as a persistent handle.
static PersistentHandle* UnwrapAsPersistentHandle(const ApiState& state,
- Dart_Handle object);
+ Dart_PersistentHandle object);
// Validates and converts the passed in handle as a weak persistent handle.
static FinalizablePersistentHandle* UnwrapAsWeakPersistentHandle(
const ApiState& state,
- Dart_Handle object);
+ Dart_WeakPersistentHandle object);
// Validates and converts the passed in handle as a prologue weak
// persistent handle.
static FinalizablePersistentHandle* UnwrapAsPrologueWeakPersistentHandle(
const ApiState& state,
- Dart_Handle object);
+ Dart_WeakPersistentHandle object);
// Returns an Error handle if isolate is in an inconsistent state.
// Returns a Success handle when no error condition exists.
@@ -154,6 +154,9 @@
// Performs one-time initialization needed by the API.
static void InitOnce();
+ // Allocates handles for objects in the VM isolate.
+ static void InitHandles();
+
// Helper function to get the peer value of an external string object.
static bool ExternalStringGetPeerHelper(Dart_Handle object, void** peer);
@@ -161,6 +164,9 @@
// Thread local key used by the API. Currently holds the current
// ApiNativeScope if any.
static ThreadLocalKey api_native_key_;
+ static Dart_Handle true_handle_;
+ static Dart_Handle false_handle_;
+ static Dart_Handle null_handle_;
friend class ApiNativeScope;
};

Powered by Google App Engine
This is Rietveld 408576698