Index: vm/dart_api_state.h |
=================================================================== |
--- vm/dart_api_state.h (revision 17884) |
+++ vm/dart_api_state.h (working copy) |
@@ -526,7 +526,8 @@ |
class ApiState { |
public: |
ApiState() : top_scope_(NULL), delayed_weak_reference_sets_(NULL), |
- null_(NULL), true_(NULL), false_(NULL) { } |
+ null_(NULL), true_(NULL), false_(NULL), |
+ callback_error_(NULL) {} |
~ApiState() { |
while (top_scope_ != NULL) { |
ApiLocalScope* scope = top_scope_; |
@@ -675,6 +676,19 @@ |
return false_; |
} |
+ void SetupCallbackError() { |
+ ASSERT(callback_error_ == NULL); |
+ callback_error_ = persistent_handles().AllocateHandle(); |
+ callback_error_->set_raw( |
+ String::New("Internal Dart data pointers have been acquired, " |
+ "please release them using Dart_ByteArrayReleaseData.")); |
+ } |
+ |
+ PersistentHandle* CallbackError() const { |
+ ASSERT(callback_error_ != NULL); |
+ return callback_error_; |
+ } |
+ |
void DelayWeakReferenceSet(WeakReferenceSet* reference_set) { |
WeakReferenceSet::Push(reference_set, &delayed_weak_reference_sets_); |
} |
@@ -690,6 +704,7 @@ |
PersistentHandle* null_; |
PersistentHandle* true_; |
PersistentHandle* false_; |
+ PersistentHandle* callback_error_; |
DISALLOW_COPY_AND_ASSIGN(ApiState); |
}; |