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

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: Add suppression for analyzer warnings. 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 | « pkg/pkg.status ('k') | runtime/lib/internal_patch.dart » ('j') | no next file with comments »
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..0358cc28ddd79b8ecfe4959164b4572596cc7245 100644
--- a/runtime/lib/core_patch.dart
+++ b/runtime/lib/core_patch.dart
@@ -205,3 +205,27 @@ class _SyncIterator implements Iterator {
}
}
}
+
+patch class Resource {
+ /* patch */ const factory Resource(String uri) = _Resource;
+}
+
+class _Resource implements Resource {
+ final String _location;
+
+ 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 | « pkg/pkg.status ('k') | runtime/lib/internal_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698