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

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

Issue 11824067: Support for embedded Dart scripts (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 | runtime/include/dart_api.h » ('j') | 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 "bin/extensions.h" 7 #include "bin/extensions.h"
8 #include "bin/directory.h" 8 #include "bin/directory.h"
9 #include "bin/file.h" 9 #include "bin/file.h"
10 #include "bin/io_buffer.h" 10 #include "bin/io_buffer.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 Dart_Handle builtin_lib) { 365 Dart_Handle builtin_lib) {
366 Dart_Handle resolved_script_uri; 366 Dart_Handle resolved_script_uri;
367 resolved_script_uri = ResolveScriptUri(NewString(script_uri), builtin_lib); 367 resolved_script_uri = ResolveScriptUri(NewString(script_uri), builtin_lib);
368 if (Dart_IsError(resolved_script_uri)) { 368 if (Dart_IsError(resolved_script_uri)) {
369 return resolved_script_uri; 369 return resolved_script_uri;
370 } 370 }
371 Dart_Handle source = ReadSource(resolved_script_uri, builtin_lib); 371 Dart_Handle source = ReadSource(resolved_script_uri, builtin_lib);
372 if (Dart_IsError(source)) { 372 if (Dart_IsError(source)) {
373 return source; 373 return source;
374 } 374 }
375 return Dart_LoadScript(resolved_script_uri, source); 375 return Dart_LoadEmbeddedScript(resolved_script_uri, source, 0, 0);
376 } 376 }
377 377
378 378
379 Dart_Handle DartUtils::LoadSource(CommandLineOptions* url_mapping, 379 Dart_Handle DartUtils::LoadSource(CommandLineOptions* url_mapping,
380 Dart_Handle library, 380 Dart_Handle library,
381 Dart_Handle url, 381 Dart_Handle url,
382 Dart_LibraryTag tag, 382 Dart_LibraryTag tag,
383 const char* url_string) { 383 const char* url_string) {
384 if (url_mapping != NULL && IsDartSchemeURL(url_string)) { 384 if (url_mapping != NULL && IsDartSchemeURL(url_string)) {
385 const char* mapped_url_string = MapLibraryUrl(url_mapping, url_string); 385 const char* mapped_url_string = MapLibraryUrl(url_mapping, url_string);
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 713
714 CObject* CObject::NewOSError(OSError* os_error) { 714 CObject* CObject::NewOSError(OSError* os_error) {
715 CObject* error_message = 715 CObject* error_message =
716 new CObjectString(CObject::NewString(os_error->message())); 716 new CObjectString(CObject::NewString(os_error->message()));
717 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); 717 CObjectArray* result = new CObjectArray(CObject::NewArray(3));
718 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); 718 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError)));
719 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); 719 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code())));
720 result->SetAt(2, error_message); 720 result->SetAt(2, error_message);
721 return result; 721 return result;
722 } 722 }
OLDNEW
« no previous file with comments | « no previous file | runtime/include/dart_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698