| 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 #ifndef BIN_DARTUTILS_H_ | 5 #ifndef BIN_DARTUTILS_H_ |
| 6 #define BIN_DARTUTILS_H_ | 6 #define BIN_DARTUTILS_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "include/dart_native_api.h" | 9 #include "include/dart_native_api.h" |
| 10 | 10 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 static bool PostNull(Dart_Port port_id); | 135 static bool PostNull(Dart_Port port_id); |
| 136 static bool PostInt32(Dart_Port port_id, int32_t value); | 136 static bool PostInt32(Dart_Port port_id, int32_t value); |
| 137 | 137 |
| 138 static Dart_Handle GetDartType(const char* library_url, | 138 static Dart_Handle GetDartType(const char* library_url, |
| 139 const char* class_name); | 139 const char* class_name); |
| 140 // Create a new Dart OSError object with the current OS error. | 140 // Create a new Dart OSError object with the current OS error. |
| 141 static Dart_Handle NewDartOSError(); | 141 static Dart_Handle NewDartOSError(); |
| 142 // Create a new Dart OSError object with the provided OS error. | 142 // Create a new Dart OSError object with the provided OS error. |
| 143 static Dart_Handle NewDartOSError(OSError* os_error); | 143 static Dart_Handle NewDartOSError(OSError* os_error); |
| 144 static Dart_Handle NewDartSocketException(const char* message, | 144 static Dart_Handle NewDartExceptionWithOSError(const char* library_url, |
| 145 Dart_Handle os_error); | 145 const char* exception_name, |
| 146 const char* message, |
| 147 Dart_Handle os_error); |
| 146 static Dart_Handle NewDartExceptionWithMessage(const char* library_url, | 148 static Dart_Handle NewDartExceptionWithMessage(const char* library_url, |
| 147 const char* exception_name, | 149 const char* exception_name, |
| 148 const char* message); | 150 const char* message); |
| 149 static Dart_Handle NewDartArgumentError(const char* message); | 151 static Dart_Handle NewDartArgumentError(const char* message); |
| 152 static Dart_Handle NewDartIOException(const char* exception_name, |
| 153 const char* message, |
| 154 Dart_Handle os_error); |
| 150 | 155 |
| 151 // Create a new Dart String object from a C String. | 156 // Create a new Dart String object from a C String. |
| 152 static Dart_Handle NewString(const char* str) { | 157 static Dart_Handle NewString(const char* str) { |
| 153 ASSERT(str != NULL); | 158 ASSERT(str != NULL); |
| 154 return Dart_NewStringFromUTF8(reinterpret_cast<const uint8_t*>(str), | 159 return Dart_NewStringFromUTF8(reinterpret_cast<const uint8_t*>(str), |
| 155 strlen(str)); | 160 strlen(str)); |
| 156 } | 161 } |
| 157 | 162 |
| 158 // Create a new Dart InternalError object with the provided message. | 163 // Create a new Dart InternalError object with the provided message. |
| 159 static Dart_Handle NewInternalError(const char* message); | 164 static Dart_Handle NewInternalError(const char* message); |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 } | 515 } |
| 511 | 516 |
| 512 private: | 517 private: |
| 513 DISALLOW_COPY_AND_ASSIGN(CObjectExternalUint8Array); | 518 DISALLOW_COPY_AND_ASSIGN(CObjectExternalUint8Array); |
| 514 }; | 519 }; |
| 515 | 520 |
| 516 } // namespace bin | 521 } // namespace bin |
| 517 } // namespace dart | 522 } // namespace dart |
| 518 | 523 |
| 519 #endif // BIN_DARTUTILS_H_ | 524 #endif // BIN_DARTUTILS_H_ |
| OLD | NEW |