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

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 2640573003: Resolution for issue #5092: Unit test handle checks consider dangling handles to be valid. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 #include "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "lib/stacktrace.h" 10 #include "lib/stacktrace.h"
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 Dart_WeakPersistentHandle object = handle->apiHandle(); 752 Dart_WeakPersistentHandle object = handle->apiHandle();
753 (*callback)(isolate->init_callback_data(), object, peer); 753 (*callback)(isolate->init_callback_data(), object, peer);
754 ApiState* state = isolate->api_state(); 754 ApiState* state = isolate->api_state();
755 ASSERT(state != NULL); 755 ASSERT(state != NULL);
756 state->weak_persistent_handles().FreeHandle(handle); 756 state->weak_persistent_handles().FreeHandle(handle);
757 } 757 }
758 758
759 759
760 // --- Handles --- 760 // --- Handles ---
761 761
762 DART_EXPORT bool Dart_IsValid(Dart_Handle handle) {
763 return Api::IsValid(handle);
764 }
765
766
762 DART_EXPORT bool Dart_IsError(Dart_Handle handle) { 767 DART_EXPORT bool Dart_IsError(Dart_Handle handle) {
763 return Api::IsError(handle); 768 return Api::IsError(handle);
764 } 769 }
765 770
766 771
767 DART_EXPORT bool Dart_IsApiError(Dart_Handle object) { 772 DART_EXPORT bool Dart_IsApiError(Dart_Handle object) {
768 return Api::ClassId(object) == kApiErrorCid; 773 return Api::ClassId(object) == kApiErrorCid;
769 } 774 }
770 775
771 776
(...skipping 6019 matching lines...) Expand 10 before | Expand all | Expand 10 after
6791 } 6796 }
6792 6797
6793 6798
6794 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { 6799 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) {
6795 #ifndef PRODUCT 6800 #ifndef PRODUCT
6796 Profiler::DumpStackTrace(context); 6801 Profiler::DumpStackTrace(context);
6797 #endif 6802 #endif
6798 } 6803 }
6799 6804
6800 } // namespace dart 6805 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698