| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #if defined(TARGET_OS_WINDOWS) | 42 #if defined(TARGET_OS_WINDOWS) |
| 43 return true; | 43 return true; |
| 44 #else // defined(TARGET_OS_WINDOWS) | 44 #else // defined(TARGET_OS_WINDOWS) |
| 45 return false; | 45 return false; |
| 46 #endif // defined(TARGET_OS_WINDOWS) | 46 #endif // defined(TARGET_OS_WINDOWS) |
| 47 } | 47 } |
| 48 | 48 |
| 49 | 49 |
| 50 // Experimental flag that offloads all script loading I/O onto | 50 // Experimental flag that offloads all script loading I/O onto |
| 51 // the service isolate. Disabled for now. | 51 // the service isolate. Disabled for now. |
| 52 // #define LOAD_VIA_SERVICE_ISOLATE | 52 #define LOAD_VIA_SERVICE_ISOLATE |
| 53 | 53 |
| 54 const char* DartUtils::MapLibraryUrl(CommandLineOptions* url_mapping, | 54 const char* DartUtils::MapLibraryUrl(CommandLineOptions* url_mapping, |
| 55 const char* url_string) { | 55 const char* url_string) { |
| 56 ASSERT(url_mapping != NULL); | 56 ASSERT(url_mapping != NULL); |
| 57 // We need to check if the passed in url is found in the url_mapping array, | 57 // We need to check if the passed in url is found in the url_mapping array, |
| 58 // in that case use the mapped entry. | 58 // in that case use the mapped entry. |
| 59 intptr_t len = strlen(url_string); | 59 intptr_t len = strlen(url_string); |
| 60 for (intptr_t idx = 0; idx < url_mapping->count(); idx++) { | 60 for (intptr_t idx = 0; idx < url_mapping->count(); idx++) { |
| 61 const char* url_name = url_mapping->GetArgument(idx); | 61 const char* url_name = url_mapping->GetArgument(idx); |
| 62 if (!strncmp(url_string, url_name, len) && (url_name[len] == ',')) { | 62 if (!strncmp(url_string, url_name, len) && (url_name[len] == ',')) { |
| (...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 new CObjectString(CObject::NewString(os_error->message())); | 1195 new CObjectString(CObject::NewString(os_error->message())); |
| 1196 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 1196 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
| 1197 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 1197 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
| 1198 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 1198 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
| 1199 result->SetAt(2, error_message); | 1199 result->SetAt(2, error_message); |
| 1200 return result; | 1200 return result; |
| 1201 } | 1201 } |
| 1202 | 1202 |
| 1203 } // namespace bin | 1203 } // namespace bin |
| 1204 } // namespace dart | 1204 } // namespace dart |
| OLD | NEW |