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

Side by Side Diff: runtime/bin/builtin.dart

Issue 2998373002: [dart:io] Move _getUriBaseClosure to dart:io (Closed)
Patch Set: Created 3 years, 3 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
« no previous file with comments | « no previous file | runtime/bin/builtin_natives.cc » ('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 library builtin; 5 library builtin;
6 6
7 // NOTE: Do not import 'dart:io' in builtin. 7 // NOTE: Do not import 'dart:io' in builtin.
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:collection' hide LinkedList, LinkedListEntry; 9 import 'dart:collection' hide LinkedList, LinkedListEntry;
10 import 'dart:_internal' hide Symbol; 10 import 'dart:_internal' hide Symbol;
(...skipping 12 matching lines...) Expand all
23 // The standalone embedder registers the closurized _print function with the 23 // The standalone embedder registers the closurized _print function with the
24 // dart:core library. 24 // dart:core library.
25 void _printString(String s) native "Builtin_PrintString"; 25 void _printString(String s) native "Builtin_PrintString";
26 26
27 void _print(arg) { 27 void _print(arg) {
28 _printString(arg.toString()); 28 _printString(arg.toString());
29 } 29 }
30 30
31 _getPrintClosure() => _print; 31 _getPrintClosure() => _print;
32 32
33 // Corelib 'Uri.base' implementation.
34 // Uri.base is susceptible to changes in the current working directory.
35 _getCurrentDirectoryPath() native "Builtin_GetCurrentDirectory";
36
37 Uri _uriBase() {
38 // We are not using Dircetory.current here to limit the dependency
39 // on dart:io. This code is the same as:
40 // return new Uri.directory(Directory.current.path);
41 var path = _getCurrentDirectoryPath();
42 return new Uri.directory(path);
43 }
44
45 _getUriBaseClosure() => _uriBase;
46
47 // Asynchronous loading of resources. 33 // Asynchronous loading of resources.
48 // The embedder forwards loading requests to the service isolate. 34 // The embedder forwards loading requests to the service isolate.
49 35
50 // A port for communicating with the service isolate for I/O. 36 // A port for communicating with the service isolate for I/O.
51 SendPort _loadPort; 37 SendPort _loadPort;
52 38
53 // The isolateId used to communicate with the service isolate for I/O. 39 // The isolateId used to communicate with the service isolate for I/O.
54 int _isolateId; 40 int _isolateId;
55 41
56 // Requests made to the service isolate over the load port. 42 // Requests made to the service isolate over the load port.
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 if (_traceLoading) { 359 if (_traceLoading) {
374 _log("Exception when resolving package URI: $packageUri"); 360 _log("Exception when resolving package URI: $packageUri");
375 } 361 }
376 result = null; 362 result = null;
377 } 363 }
378 if (_traceLoading) { 364 if (_traceLoading) {
379 _log("Resolved '$packageUri' to '$result'"); 365 _log("Resolved '$packageUri' to '$result'");
380 } 366 }
381 return result; 367 return result;
382 } 368 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/builtin_natives.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698