| 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 "bin/file.h" | 7 #include "bin/file.h" |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/globals.h" | 10 #include "platform/globals.h" |
| 11 | 11 |
| 12 const char* DartUtils::kDartScheme = "dart:"; | 12 const char* DartUtils::kDartScheme = "dart:"; |
| 13 const char* DartUtils::kBuiltinLibURL = "dart:builtin"; | 13 const char* DartUtils::kBuiltinLibURL = "dart:builtin"; |
| 14 const char* DartUtils::kCoreLibURL = "dart:core"; | 14 const char* DartUtils::kCoreLibURL = "dart:core"; |
| 15 const char* DartUtils::kCoreImplLibURL = "dart:coreimpl"; | 15 const char* DartUtils::kCoreImplLibURL = "dart:coreimpl"; |
| 16 const char* DartUtils::kIOLibURL = "dart:io"; | 16 const char* DartUtils::kIOLibURL = "dart:io"; |
| 17 const char* DartUtils::kJsonLibURL = "dart:json"; | 17 const char* DartUtils::kJsonLibURL = "dart:json"; |
| 18 const char* DartUtils::kUriLibURL = "dart:uri"; | 18 const char* DartUtils::kUriLibURL = "dart:uri"; |
| 19 const char* DartUtils::kUtf8LibURL = "dart:utf8"; | 19 const char* DartUtils::kUtf8LibURL = "dart:utf8"; |
| 20 const char* DartUtils::kIsolateLibURL = "dart:isolate"; |
| 20 | 21 |
| 21 | 22 |
| 22 const char* DartUtils::kIdFieldName = "_id"; | 23 const char* DartUtils::kIdFieldName = "_id"; |
| 23 | 24 |
| 24 | 25 |
| 25 static const char* MapLibraryUrl(CommandLineOptions* url_mapping, | 26 static const char* MapLibraryUrl(CommandLineOptions* url_mapping, |
| 26 const char* url_string) { | 27 const char* url_string) { |
| 27 ASSERT(url_mapping != NULL); | 28 ASSERT(url_mapping != NULL); |
| 28 // We need to check if the passed in url is found in the url_mapping array, | 29 // We need to check if the passed in url is found in the url_mapping array, |
| 29 // in that case use the mapped entry. | 30 // in that case use the mapped entry. |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 bool DartUtils::PostInt32(Dart_Port port_id, int32_t value) { | 262 bool DartUtils::PostInt32(Dart_Port port_id, int32_t value) { |
| 262 // Post a message with the integer value. | 263 // Post a message with the integer value. |
| 263 int32_t min = 0xc0000000; // -1073741824 | 264 int32_t min = 0xc0000000; // -1073741824 |
| 264 int32_t max = 0x3fffffff; // 1073741823 | 265 int32_t max = 0x3fffffff; // 1073741823 |
| 265 ASSERT(min <= value && value < max); | 266 ASSERT(min <= value && value < max); |
| 266 Dart_CObject object; | 267 Dart_CObject object; |
| 267 object.type = Dart_CObject::kInt32; | 268 object.type = Dart_CObject::kInt32; |
| 268 object.value.as_int32 = value; | 269 object.value.as_int32 = value; |
| 269 return Dart_PostCObject(port_id, &object); | 270 return Dart_PostCObject(port_id, &object); |
| 270 } | 271 } |
| OLD | NEW |