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

Side by Side Diff: runtime/vm/dart_api_state.h

Issue 1156993012: Fix for issue 23547, return an proper ApiError instead of a string when we report outstanding typed… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_DART_API_STATE_H_ 5 #ifndef VM_DART_API_STATE_H_
6 #define VM_DART_API_STATE_H_ 6 #define VM_DART_API_STATE_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 9
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 ApiLocalScope* scope = top_scope_; 811 ApiLocalScope* scope = top_scope_;
812 while (scope != NULL) { 812 while (scope != NULL) {
813 total += scope->zone()->SizeInBytes(); 813 total += scope->zone()->SizeInBytes();
814 scope = scope->previous(); 814 scope = scope->previous();
815 } 815 }
816 return total; 816 return total;
817 } 817 }
818 818
819 void SetupAcquiredError() { 819 void SetupAcquiredError() {
820 ASSERT(acquired_error_ == NULL); 820 ASSERT(acquired_error_ == NULL);
821 acquired_error_ = persistent_handles().AllocateHandle(); 821 const String& msg = String::Handle(
822 acquired_error_->set_raw(
823 String::New("Internal Dart data pointers have been acquired, " 822 String::New("Internal Dart data pointers have been acquired, "
824 "please release them using Dart_TypedDataReleaseData.")); 823 "please release them using Dart_TypedDataReleaseData."));
824 acquired_error_ = persistent_handles().AllocateHandle();
825 acquired_error_->set_raw(ApiError::New(msg));
825 } 826 }
826 827
827 PersistentHandle* AcquiredError() const { 828 PersistentHandle* AcquiredError() const {
828 ASSERT(acquired_error_ != NULL); 829 ASSERT(acquired_error_ != NULL);
829 return acquired_error_; 830 return acquired_error_;
830 } 831 }
831 832
832 WeakReferenceSetBuilder* NewWeakReferenceSetBuilder(); 833 WeakReferenceSetBuilder* NewWeakReferenceSetBuilder();
833 834
834 void DelayWeakReferenceSet(WeakReferenceSet* reference_set); 835 void DelayWeakReferenceSet(WeakReferenceSet* reference_set);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 ref->set_peer(peer); 976 ref->set_peer(peer);
976 ref->set_callback(callback); 977 ref->set_callback(callback);
977 // This may trigger GC, so it must be called last. 978 // This may trigger GC, so it must be called last.
978 ref->SetExternalSize(external_size, isolate); 979 ref->SetExternalSize(external_size, isolate);
979 return ref; 980 return ref;
980 } 981 }
981 982
982 } // namespace dart 983 } // namespace dart
983 984
984 #endif // VM_DART_API_STATE_H_ 985 #endif // VM_DART_API_STATE_H_
OLDNEW
« 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