| 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 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 | 9 |
| 10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 uint8_t* data = IOBuffer::Allocate(static_cast<intptr_t>(length)); | 1074 uint8_t* data = IOBuffer::Allocate(static_cast<intptr_t>(length)); |
| 1075 ASSERT(data != NULL); | 1075 ASSERT(data != NULL); |
| 1076 return NewExternalUint8Array( | 1076 return NewExternalUint8Array( |
| 1077 static_cast<intptr_t>(length), data, data, IOBuffer::Finalizer); | 1077 static_cast<intptr_t>(length), data, data, IOBuffer::Finalizer); |
| 1078 } | 1078 } |
| 1079 | 1079 |
| 1080 | 1080 |
| 1081 void CObject::FreeIOBufferData(Dart_CObject* cobject) { | 1081 void CObject::FreeIOBufferData(Dart_CObject* cobject) { |
| 1082 ASSERT(cobject->type == Dart_CObject_kExternalTypedData); | 1082 ASSERT(cobject->type == Dart_CObject_kExternalTypedData); |
| 1083 cobject->value.as_external_typed_data.callback( | 1083 cobject->value.as_external_typed_data.callback( |
| 1084 NULL, cobject->value.as_external_typed_data.peer); | 1084 NULL, |
| 1085 NULL, |
| 1086 cobject->value.as_external_typed_data.peer); |
| 1085 cobject->value.as_external_typed_data.data = NULL; | 1087 cobject->value.as_external_typed_data.data = NULL; |
| 1086 } | 1088 } |
| 1087 | 1089 |
| 1088 | 1090 |
| 1089 CObject* CObject::IllegalArgumentError() { | 1091 CObject* CObject::IllegalArgumentError() { |
| 1090 CObjectArray* result = new CObjectArray(CObject::NewArray(1)); | 1092 CObjectArray* result = new CObjectArray(CObject::NewArray(1)); |
| 1091 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kArgumentError))); | 1093 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kArgumentError))); |
| 1092 return result; | 1094 return result; |
| 1093 } | 1095 } |
| 1094 | 1096 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1110 new CObjectString(CObject::NewString(os_error->message())); | 1112 new CObjectString(CObject::NewString(os_error->message())); |
| 1111 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 1113 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
| 1112 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 1114 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
| 1113 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 1115 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
| 1114 result->SetAt(2, error_message); | 1116 result->SetAt(2, error_message); |
| 1115 return result; | 1117 return result; |
| 1116 } | 1118 } |
| 1117 | 1119 |
| 1118 } // namespace bin | 1120 } // namespace bin |
| 1119 } // namespace dart | 1121 } // namespace dart |
| OLD | NEW |