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

Side by Side Diff: mojo/dart/embedder/builtin.dart

Issue 1132063007: Rationalize Dart mojo and sky package structure (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 | « mojo/dart/embedder/BUILD.gn ('k') | mojo/dart/embedder/io/mojo_patch.dart » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 library mojo_builtin; 5 library mojo_builtin;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:mojo.internal'; 9 import 'dart:mojo.internal';
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 void _setWorkingDirectory(cwd) { 56 void _setWorkingDirectory(cwd) {
57 cwd = _enforceTrailingSlash(cwd); 57 cwd = _enforceTrailingSlash(cwd);
58 _workingDirectoryUri = new Uri(scheme: 'file', path: cwd); 58 _workingDirectoryUri = new Uri(scheme: 'file', path: cwd);
59 if (_logBuiltin) { 59 if (_logBuiltin) {
60 _print('# Working Directory: $cwd'); 60 _print('# Working Directory: $cwd');
61 } 61 }
62 } 62 }
63 63
64 _setPackageRoot(String packageRoot) { 64 _setPackageRoot(String packageRoot) {
65 packageRoot = _enforceTrailingSlash(packageRoot); 65 packageRoot = _enforceTrailingSlash(packageRoot);
66
66 if (packageRoot.startsWith('file:') || 67 if (packageRoot.startsWith('file:') ||
67 packageRoot.startsWith('http:') || 68 packageRoot.startsWith('http:') ||
68 packageRoot.startsWith('https:')) { 69 packageRoot.startsWith('https:')) {
69 _packageRoot = _workingDirectoryUri.resolve(packageRoot); 70 _packageRoot = _workingDirectoryUri.resolve(packageRoot);
70 } else { 71 } else {
71 _packageRoot = _workingDirectoryUri.resolveUri(new Uri.file(packageRoot)); 72 _packageRoot = _workingDirectoryUri.resolveUri(new Uri.file(packageRoot));
72 } 73 }
73 if (_logBuiltin) { 74 if (_logBuiltin) {
74 _print('# Package root: $packageRoot -> $_packageRoot'); 75 _print('# Package root: $packageRoot -> $_packageRoot');
75 } 76 }
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 // _loadScript(tag, uri, libraryUri, data); 225 // _loadScript(tag, uri, libraryUri, data);
225 // }); 226 // });
226 throw 'Cannot load http, yet.'; 227 throw 'Cannot load http, yet.';
227 } else { 228 } else {
228 // Mojo does not expose any asynchronous file IO calls, but we'll maintain 229 // Mojo does not expose any asynchronous file IO calls, but we'll maintain
229 // the same structure as the standalone embedder here in case it ever does. 230 // the same structure as the standalone embedder here in case it ever does.
230 var data = readSync(resourceUri.toFilePath()); 231 var data = readSync(resourceUri.toFilePath());
231 _loadScript(tag, uri, libraryUri, data); 232 _loadScript(tag, uri, libraryUri, data);
232 } 233 }
233 } 234 }
OLDNEW
« no previous file with comments | « mojo/dart/embedder/BUILD.gn ('k') | mojo/dart/embedder/io/mojo_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698