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

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

Issue 1374953002: Remove Resource class and support functions. Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Remove reference to resource class in dart2js compiler. Created 5 years, 2 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 | « pkg/package_test_data/pubspec.yaml ('k') | runtime/lib/core_sources.gypi » ('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 // NOTE: Do not import 'dart:io' in builtin. 6 // NOTE: Do not import 'dart:io' in builtin.
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:_internal'; 9 import 'dart:_internal';
10 import 'dart:isolate'; 10 import 'dart:isolate';
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 } else { 628 } else {
629 result = baseUri.resolve(userString).toString(); 629 result = baseUri.resolve(userString).toString();
630 } 630 }
631 if (_traceLoading) { 631 if (_traceLoading) {
632 _log('Resolved $userString in $base to $result'); 632 _log('Resolved $userString in $base to $result');
633 } 633 }
634 return result; 634 return result;
635 } 635 }
636 636
637 637
638 // Handling of Resource class by dispatching to the load port.
639 Future<List<int>> _resourceReadAsBytes(Uri uri) {
640 var completer = new Completer<List<int>>();
641 // Request the load of the resource associating the completer as the context
642 // for the load.
643 _loadData(_Dart_kResourceLoad, uri.toString(), uri, completer);
Ivan Posva 2015/10/05 12:49:19 This was the only active use of the _Dart_kResourc
644 // Return the future that will be triggered once the resource has been loaded.
645 return completer.future;
646 }
647
648
649 // Embedder Entrypoint (gen_snapshot): 638 // Embedder Entrypoint (gen_snapshot):
650 // Resolve relative paths relative to working directory. 639 // Resolve relative paths relative to working directory.
651 String _resolveInWorkingDirectory(String fileName) { 640 String _resolveInWorkingDirectory(String fileName) {
652 if (!_setupCompleted) { 641 if (!_setupCompleted) {
653 _setupHooks(); 642 _setupHooks();
654 } 643 }
655 if (_workingDirectory == null) { 644 if (_workingDirectory == null) {
656 throw 'No current working directory set.'; 645 throw 'No current working directory set.';
657 } 646 }
658 var name = _sanitizeWindowsPath(fileName); 647 var name = _sanitizeWindowsPath(fileName);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 path = _filePathFromUri(path); 743 path = _filePathFromUri(path);
755 var filename = _platformExtensionFileName(name); 744 var filename = _platformExtensionFileName(name);
756 745
757 return [path, filename, name]; 746 return [path, filename, name];
758 } 747 }
759 748
760 749
761 // Register callbacks and hooks with the rest of the core libraries. 750 // Register callbacks and hooks with the rest of the core libraries.
762 _setupHooks() { 751 _setupHooks() {
763 _setupCompleted = true; 752 _setupCompleted = true;
764 VMLibraryHooks.resourceReadAsBytes = _resourceReadAsBytes;
765 } 753 }
OLDNEW
« no previous file with comments | « pkg/package_test_data/pubspec.yaml ('k') | runtime/lib/core_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698