Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: runtime/bin/dartutils.cc

Issue 980043002: Enable loading via service isolate (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698