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

Unified Diff: sdk/lib/io/http_parser.dart

Issue 59673006: Use typed-data views for incoming http data. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | tests/standalone/io/http_parser_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_parser.dart
diff --git a/sdk/lib/io/http_parser.dart b/sdk/lib/io/http_parser.dart
index 498cd021f9c63fbae7e389d125c48053ac311b9e..31705f27ddcbbc575d6f1be7baf82e020e44d684 100644
--- a/sdk/lib/io/http_parser.dart
+++ b/sdk/lib/io/http_parser.dart
@@ -664,12 +664,14 @@ class _HttpParser
if (_index == 0) {
data = _buffer;
} else {
- data = new Uint8List(dataAvailable);
- data.setRange(0, dataAvailable, _buffer, _index);
+ data = new Uint8List.view(_buffer.buffer,
+ _index,
+ dataAvailable);
}
} else {
- data = new Uint8List(_remainingContent);
- data.setRange(0, _remainingContent, _buffer, _index);
+ data = new Uint8List.view(_buffer.buffer,
+ _index,
+ _remainingContent);
}
_bodyController.add(data);
if (_remainingContent != -1) {
@@ -955,7 +957,7 @@ class _HttpParser
bool _parserCalled = false;
// The data that is currently being parsed.
- List<int> _buffer;
+ Uint8List _buffer;
int _index;
final bool _requestParser;
« no previous file with comments | « no previous file | tests/standalone/io/http_parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698