OLD | NEW |
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 #include "bin/dartutils.h" | 5 #include "bin/dartutils.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 | 8 |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "platform/globals.h" | 10 #include "platform/globals.h" |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 | 776 |
777 | 777 |
778 void CObject::FreeIOBufferData(Dart_CObject* cobject) { | 778 void CObject::FreeIOBufferData(Dart_CObject* cobject) { |
779 ASSERT(cobject->type == Dart_CObject::kExternalTypedData); | 779 ASSERT(cobject->type == Dart_CObject::kExternalTypedData); |
780 cobject->value.as_external_typed_data.callback( | 780 cobject->value.as_external_typed_data.callback( |
781 NULL, cobject->value.as_external_typed_data.peer); | 781 NULL, cobject->value.as_external_typed_data.peer); |
782 cobject->value.as_external_typed_data.data = NULL; | 782 cobject->value.as_external_typed_data.data = NULL; |
783 } | 783 } |
784 | 784 |
785 | 785 |
786 static int kArgumentError = 1; | |
787 static int kOSError = 2; | |
788 static int kFileClosedError = 3; | |
789 | |
790 | |
791 CObject* CObject::IllegalArgumentError() { | 786 CObject* CObject::IllegalArgumentError() { |
792 CObjectArray* result = new CObjectArray(CObject::NewArray(1)); | 787 CObjectArray* result = new CObjectArray(CObject::NewArray(1)); |
793 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kArgumentError))); | 788 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kArgumentError))); |
794 return result; | 789 return result; |
795 } | 790 } |
796 | 791 |
797 | 792 |
798 CObject* CObject::FileClosedError() { | 793 CObject* CObject::FileClosedError() { |
799 CObjectArray* result = new CObjectArray(CObject::NewArray(1)); | 794 CObjectArray* result = new CObjectArray(CObject::NewArray(1)); |
800 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kFileClosedError))); | 795 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kFileClosedError))); |
(...skipping 11 matching lines...) Expand all Loading... |
812 new CObjectString(CObject::NewString(os_error->message())); | 807 new CObjectString(CObject::NewString(os_error->message())); |
813 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 808 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
814 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 809 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
815 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 810 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
816 result->SetAt(2, error_message); | 811 result->SetAt(2, error_message); |
817 return result; | 812 return result; |
818 } | 813 } |
819 | 814 |
820 } // namespace bin | 815 } // namespace bin |
821 } // namespace dart | 816 } // namespace dart |
OLD | NEW |