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

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

Issue 16097013: Make my pkg packages warning-clean. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: pkg/http/lib/src/utils.dart
diff --git a/pkg/http/lib/src/utils.dart b/pkg/http/lib/src/utils.dart
index 7be3938116c20a2795895fbc2c214cc4efe2405b..9125ddcbd3ce1e7d6b1649f7e0103405b04e496c 100644
--- a/pkg/http/lib/src/utils.dart
+++ b/pkg/http/lib/src/utils.dart
@@ -113,11 +113,14 @@ final RegExp _ASCII_ONLY = new RegExp(r"^[\x00-\x7F]+$");
/// characters.
bool isPlainAscii(String string) => _ASCII_ONLY.hasMatch(string);
-/// Converts [input] into a [Uint8List]. If [input] is a [ByteArray] or
-/// [ByteArrayViewable], this just returns a view on [input].
+/// Converts [input] into a [Uint8List]. If [input] is a [TypedData], this just
+/// returns a view on [input].
Uint8List toUint8List(List<int> input) {
if (input is Uint8List) return input;
- if (input is ByteData) return new Uint8List.view(input.buffer);
+ if (input is TypedData) {
+ // TODO(nweiz): remove this "as" check when issue 11080 is fixed.
+ return new Uint8List.view((input as TypedData).buffer);
+ }
var output = new Uint8List(input.length);
output.setRange(0, input.length, input);
return output;
« no previous file with comments | « no previous file | pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart » ('j') | pkg/yaml/lib/src/yaml_map.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698