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

Unified Diff: pkg/http/lib/src/io.dart

Issue 299483002: Support a user-supplied dart:io client in pkg/http. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/http/CHANGELOG.md ('k') | pkg/http/lib/src/io_client.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/src/io.dart
diff --git a/pkg/http/lib/src/io.dart b/pkg/http/lib/src/io.dart
index 1730706331f41b112334f40876e13c4e1b787d6b..767dda054a2f61638e5eecaaf82220e3ae35e0c5 100644
--- a/pkg/http/lib/src/io.dart
+++ b/pkg/http/lib/src/io.dart
@@ -43,6 +43,9 @@ newFile(String path) => _file.newInstance(const Symbol(''), [path]).reflectee;
/// Returns whether [error] is a `dart:io` HttpException.
bool isHttpException(error) => reflect(error).type.isSubtypeOf(_httpException);
+/// Returns whether [client] is a `dart:io` HttpClient.
+bool isHttpClient(client) => reflect(client).type.isSubtypeOf(_httpClient);
+
/// Tries to load `dart:io` and returns `null` if it fails.
LibraryMirror _getLibrary() {
try {
« no previous file with comments | « pkg/http/CHANGELOG.md ('k') | pkg/http/lib/src/io_client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698