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

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

Issue 12817003: Change getRange to sublist. Make getRange deprecated. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 9 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: sdk/lib/io/websocket_impl.dart
diff --git a/sdk/lib/io/websocket_impl.dart b/sdk/lib/io/websocket_impl.dart
index d14682544c8b1beebabd1e59f23b22eec5c45787..fcbe1ca857dce9f701f2e80bd50c43847917df4a 100644
--- a/sdk/lib/io/websocket_impl.dart
+++ b/sdk/lib/io/websocket_impl.dart
@@ -173,7 +173,7 @@ class _WebSocketProtocolTransformer extends StreamEventTransformer {
if (_controlPayload == null) {
_controlPayload = new List<int>();
}
- _controlPayload.addAll(buffer.getRange(index, payload));
+ _controlPayload.addAll(buffer.sublist(index, index + payload));
index += payload;
}
@@ -186,7 +186,8 @@ class _WebSocketProtocolTransformer extends StreamEventTransformer {
throw new WebSocketException("Protocol error");
case _WebSocketMessageType.TEXT:
- _buffer.write(_decodeString(buffer.getRange(index, payload)));
+ _buffer.write(_decodeString(
+ buffer.sublist(index, index + payload)));
index += payload;
if (_remainingPayloadBytes == 0) {
_messageFrameEnd(sink);
@@ -194,7 +195,7 @@ class _WebSocketProtocolTransformer extends StreamEventTransformer {
break;
case _WebSocketMessageType.BINARY:
- _buffer.write(buffer.getRange(index, payload));
+ _buffer.write(buffer.sublist(index, index + payload));
index += payload;
if (_remainingPayloadBytes == 0) {
_messageFrameEnd(sink);
@@ -295,7 +296,7 @@ class _WebSocketProtocolTransformer extends StreamEventTransformer {
}
if (_controlPayload.length > 2) {
closeReason = _decodeString(
- _controlPayload.getRange(2, _controlPayload.length - 2));
+ _controlPayload.sublist(2));
}
}
_state = CLOSED;

Powered by Google App Engine
This is Rietveld 408576698