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

Side by Side Diff: bin/main.cc

Issue 9417012: - Add dart:json, dart:uri and dart:utf8 to the known and builtin libraries. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 10 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
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 <stdlib.h> 5 #include <stdlib.h>
6 #include <string.h> 6 #include <string.h>
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "include/dart_api.h" 9 #include "include/dart_api.h"
10 #include "include/dart_debugger_api.h" 10 #include "include/dart_debugger_api.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 if (tag == kCanonicalizeUrl) { 260 if (tag == kCanonicalizeUrl) {
261 // If this is a Dart Scheme URL then it is not modified as it will be 261 // If this is a Dart Scheme URL then it is not modified as it will be
262 // handled by the VM internally. 262 // handled by the VM internally.
263 if (is_dart_scheme_url) { 263 if (is_dart_scheme_url) {
264 return url; 264 return url;
265 } 265 }
266 // Create a canonical path based on the including library and current url. 266 // Create a canonical path based on the including library and current url.
267 return DartUtils::CanonicalizeURL(NULL, library, url_string); 267 return DartUtils::CanonicalizeURL(NULL, library, url_string);
268 } 268 }
269 if (is_dart_scheme_url) { 269 if (is_dart_scheme_url) {
270 // Handle imports of dart:io. 270 // Handle imports of dart:io.
siva 2012/02/16 18:44:17 The comment is invalid now, maybe // handle import
Ivan Posva 2012/02/16 19:58:50 Done.
271 if (DartUtils::IsDartIOLibURL(url_string) && (tag == kImportTag)) { 271 if (DartUtils::IsDartIOLibURL(url_string) && (tag == kImportTag)) {
siva 2012/02/16 18:44:17 I don't think we need this (tag == kImportTag) che
Ivan Posva 2012/02/16 19:58:50 Done.
272 return Builtin::LoadLibrary(Builtin::kIOLibrary); 272 return Builtin::LoadLibrary(Builtin::kIOLibrary);
273 } else if (DartUtils::IsDartJsonLibURL(url_string) && (tag == kImportTag)) {
274 return Builtin::LoadLibrary(Builtin::kJsonLibrary);
275 } else if (DartUtils::IsDartUriLibURL(url_string) && (tag == kImportTag)) {
276 return Builtin::LoadLibrary(Builtin::kUriLibrary);
277 } else if (DartUtils::IsDartUtf8LibURL(url_string) && (tag == kImportTag)) {
278 return Builtin::LoadLibrary(Builtin::kUtf8Library);
turnidge 2012/02/16 17:42:02 Do you notice that here we take a url and convert
Ivan Posva 2012/02/16 19:58:50 Yes, I did notice this back and forth. But I decid
273 } else { 279 } else {
274 return Dart_Error("Do not know how to load '%s'", url_string); 280 return Dart_Error("Do not know how to load '%s'", url_string);
275 } 281 }
276 } 282 }
277 result = DartUtils::LoadSource(NULL, 283 result = DartUtils::LoadSource(NULL,
278 library, 284 library,
279 url, 285 url,
280 tag, 286 tag,
281 url_string, 287 url_string,
282 import_map); 288 import_map);
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 DumpPprofSymbolInfo(); 616 DumpPprofSymbolInfo();
611 // Shutdown the isolate. 617 // Shutdown the isolate.
612 Dart_ShutdownIsolate(); 618 Dart_ShutdownIsolate();
613 // Terminate event handler. 619 // Terminate event handler.
614 EventHandler::Terminate(); 620 EventHandler::Terminate();
615 // Terminate process exit-code handler. 621 // Terminate process exit-code handler.
616 Process::TerminateExitCodeHandler(); 622 Process::TerminateExitCodeHandler();
617 623
618 return 0; 624 return 0;
619 } 625 }
OLDNEW
« bin/dartutils.h ('K') | « bin/json_sources.gypi ('k') | bin/uri_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698