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

Unified Diff: runtime/lib/core_patch.dart

Issue 1181663002: Add Resource class. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/lib/internal_patch.dart » ('j') | runtime/lib/internal_patch.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/core_patch.dart
diff --git a/runtime/lib/core_patch.dart b/runtime/lib/core_patch.dart
index 2a45ae708efed16d1b8b4276978c5a8cd8b28de5..fc778c11ddc95a15445036ac44a282f26f4febac 100644
--- a/runtime/lib/core_patch.dart
+++ b/runtime/lib/core_patch.dart
@@ -4,6 +4,7 @@
import "dart:math";
import "dart:typed_data";
+import "dart:convert" show UTF8;
Ivan Posva 2015/06/12 10:51:03 Not needed. Please remove.
// Equivalent of calling FATAL from C++ code.
_fatal(msg) native "DartCore_fatal";
@@ -205,3 +206,27 @@ class _SyncIterator implements Iterator {
}
}
}
+
+patch class Resource {
+ /* patch */ const factory Resource(String uri) = _Resource;
+}
+
+class _Resource implements Resource {
+ final String _location;
+
+ /* patch */ const _Resource(String uri) : _location = uri;
+
+ Uri get uri => Uri.base.resolve(_location);
+
+ Stream<List<int>> openRead() {
+ throw new UnimplementedError("openRead");
+ }
+
+ Future<List<int>> readAsBytes() {
+ throw new UnimplementedError("readAsBytes");
+ }
+
+ Future<String> readAsString({Encoding encoding}) {
+ throw new UnimplementedError("readAsString");
+ }
+}
« no previous file with comments | « no previous file | runtime/lib/internal_patch.dart » ('j') | runtime/lib/internal_patch.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698