| 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 "bin/builtin.h" | 8 #include "bin/builtin.h" |
| 9 #include "bin/utils.h" | 9 #include "bin/utils.h" |
| 10 #include "include/dart_api.h" | 10 #include "include/dart_api.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 const char* message); | 132 const char* message); |
| 133 static Dart_Handle NewDartArgumentError(const char* message); | 133 static Dart_Handle NewDartArgumentError(const char* message); |
| 134 | 134 |
| 135 // Create a new Dart String object from a C String. | 135 // Create a new Dart String object from a C String. |
| 136 static Dart_Handle NewString(const char* str) { | 136 static Dart_Handle NewString(const char* str) { |
| 137 ASSERT(str != NULL); | 137 ASSERT(str != NULL); |
| 138 return Dart_NewStringFromUTF8(reinterpret_cast<const uint8_t*>(str), | 138 return Dart_NewStringFromUTF8(reinterpret_cast<const uint8_t*>(str), |
| 139 strlen(str)); | 139 strlen(str)); |
| 140 } | 140 } |
| 141 | 141 |
| 142 // Create a new Dart InternalError object with the provided message. |
| 143 static Dart_Handle NewInternalError(const char* message); |
| 144 |
| 142 static void SetOriginalWorkingDirectory(); | 145 static void SetOriginalWorkingDirectory(); |
| 143 | 146 |
| 144 static const char* MapLibraryUrl(CommandLineOptions* url_mapping, | 147 static const char* MapLibraryUrl(CommandLineOptions* url_mapping, |
| 145 const char* url_string); | 148 const char* url_string); |
| 146 | 149 |
| 147 static Dart_Handle ResolveScriptUri(Dart_Handle script_uri, | 150 static Dart_Handle ResolveScriptUri(Dart_Handle script_uri, |
| 148 Dart_Handle builtin_lib); | 151 Dart_Handle builtin_lib); |
| 149 | 152 |
| 150 static Dart_Handle FilePathFromUri(Dart_Handle script_uri, | 153 static Dart_Handle FilePathFromUri(Dart_Handle script_uri, |
| 151 Dart_Handle builtin_lib); | 154 Dart_Handle builtin_lib); |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 void* Peer() const { return cobject_->value.as_external_byte_array.peer; } | 411 void* Peer() const { return cobject_->value.as_external_byte_array.peer; } |
| 409 Dart_WeakPersistentHandleFinalizer Callback() const { | 412 Dart_WeakPersistentHandleFinalizer Callback() const { |
| 410 return cobject_->value.as_external_byte_array.callback; | 413 return cobject_->value.as_external_byte_array.callback; |
| 411 } | 414 } |
| 412 | 415 |
| 413 private: | 416 private: |
| 414 DISALLOW_COPY_AND_ASSIGN(CObjectExternalUint8Array); | 417 DISALLOW_COPY_AND_ASSIGN(CObjectExternalUint8Array); |
| 415 }; | 418 }; |
| 416 | 419 |
| 417 #endif // BIN_DARTUTILS_H_ | 420 #endif // BIN_DARTUTILS_H_ |
| OLD | NEW |