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

Unified Diff: runtime/vm/dart_api_state.h

Issue 13171004: - The callback_error_ handle was never being setup. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_state.h
===================================================================
--- runtime/vm/dart_api_state.h (revision 20700)
+++ runtime/vm/dart_api_state.h (working copy)
@@ -527,7 +527,7 @@
public:
ApiState() : top_scope_(NULL), delayed_weak_reference_sets_(NULL),
null_(NULL), true_(NULL), false_(NULL),
- callback_error_(NULL) {}
+ acquired_error_(NULL) {}
~ApiState() {
while (top_scope_ != NULL) {
ApiLocalScope* scope = top_scope_;
@@ -546,6 +546,10 @@
persistent_handles().FreeHandle(false_);
false_ = NULL;
}
+ if (acquired_error_ != NULL) {
+ persistent_handles().FreeHandle(acquired_error_);
+ acquired_error_ = NULL;
+ }
}
// Accessors.
@@ -651,18 +655,13 @@
}
PersistentHandle* Null() {
if (null_ == NULL) {
- DARTSCOPE(Isolate::Current());
-
- Object& null_object = Object::Handle();
null_ = persistent_handles().AllocateHandle();
- null_->set_raw(null_object);
+ null_->set_raw(Object::null());
}
return null_;
}
PersistentHandle* True() {
if (true_ == NULL) {
- DARTSCOPE(Isolate::Current());
-
true_ = persistent_handles().AllocateHandle();
true_->set_raw(Bool::True());
}
@@ -670,25 +669,23 @@
}
PersistentHandle* False() {
if (false_ == NULL) {
- DARTSCOPE(Isolate::Current());
-
false_ = persistent_handles().AllocateHandle();
false_->set_raw(Bool::False());
}
return false_;
}
- void SetupCallbackError() {
- ASSERT(callback_error_ == NULL);
- callback_error_ = persistent_handles().AllocateHandle();
- callback_error_->set_raw(
+ void SetupAcquiredError() {
+ ASSERT(acquired_error_ == NULL);
+ acquired_error_ = persistent_handles().AllocateHandle();
+ acquired_error_->set_raw(
String::New("Internal Dart data pointers have been acquired, "
- "please release them using Dart_ByteArrayReleaseData."));
+ "please release them using Dart_TypedDataReleaseData."));
}
- PersistentHandle* CallbackError() const {
- ASSERT(callback_error_ != NULL);
- return callback_error_;
+ PersistentHandle* AcquiredError() const {
+ ASSERT(acquired_error_ != NULL);
+ return acquired_error_;
}
void DelayWeakReferenceSet(WeakReferenceSet* reference_set) {
@@ -706,7 +703,7 @@
PersistentHandle* null_;
PersistentHandle* true_;
PersistentHandle* false_;
- PersistentHandle* callback_error_;
+ PersistentHandle* acquired_error_;
DISALLOW_COPY_AND_ASSIGN(ApiState);
};
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698