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

Side by Side Diff: runtime/bin/directory_patch.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 | « runtime/bin/dartutils.cc ('k') | runtime/bin/main.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 @patch 5 @patch
6 class _Directory { 6 class _Directory {
7 @patch 7 @patch
8 static _current() native "Directory_Current"; 8 static _current() native "Directory_Current";
9 @patch 9 @patch
10 static _setCurrent(path) native "Directory_SetCurrent"; 10 static _setCurrent(path) native "Directory_SetCurrent";
(...skipping 28 matching lines...) Expand all
39 implements _AsyncDirectoryListerOps { 39 implements _AsyncDirectoryListerOps {
40 _AsyncDirectoryListerOpsImpl._(); 40 _AsyncDirectoryListerOpsImpl._();
41 41
42 factory _AsyncDirectoryListerOpsImpl(int pointer) => 42 factory _AsyncDirectoryListerOpsImpl(int pointer) =>
43 new _AsyncDirectoryListerOpsImpl._().._setPointer(pointer); 43 new _AsyncDirectoryListerOpsImpl._().._setPointer(pointer);
44 44
45 void _setPointer(int pointer) 45 void _setPointer(int pointer)
46 native "Directory_SetAsyncDirectoryListerPointer"; 46 native "Directory_SetAsyncDirectoryListerPointer";
47 int getPointer() native "Directory_GetAsyncDirectoryListerPointer"; 47 int getPointer() native "Directory_GetAsyncDirectoryListerPointer";
48 } 48 }
49
50 // Corelib 'Uri.base' implementation.
51 // Uri.base is susceptible to changes in the current working directory.
52 Uri _uriBaseClosure() {
53 var result = _Directory._current();
54 if (result is OSError) {
55 throw new FileSystemException(
56 "Getting current working directory failed", "", result);
57 }
58 return new Uri.directory(result);
59 }
60
61 _getUriBaseClosure() => _uriBaseClosure;
OLDNEW
« no previous file with comments | « runtime/bin/dartutils.cc ('k') | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698