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

Unified Diff: vm/dart_api_state.h

Issue 12036098: First set of changes towards cleaning up the bytearray access APIs (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: 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 | « vm/dart_api_impl_test.cc ('k') | vm/dart_entry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « vm/dart_api_impl_test.cc ('k') | vm/dart_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698