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

Unified Diff: runtime/bin/socket_impl.dart

Issue 11023003: Clean up file implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 3 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 | « runtime/bin/file_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_impl.dart
diff --git a/runtime/bin/socket_impl.dart b/runtime/bin/socket_impl.dart
index 08f24d01937210c1a58fa80d1131bf6cfbb8c9b8..5ad2319215950427e345687db4032d08f9f6421c 100644
--- a/runtime/bin/socket_impl.dart
+++ b/runtime/bin/socket_impl.dart
@@ -207,10 +207,10 @@ class _SocketBase extends NativeFieldWrapperClass1 {
} else if (error is List) {
assert(_isErrorResponse(error));
switch (error[0]) {
- case _FileUtils.ILLEGAL_ARGUMENT_RESPONSE:
+ case _ILLEGAL_ARGUMENT_RESPONSE:
doReportError(new ArgumentError());
break;
- case _FileUtils.OSERROR_RESPONSE:
+ case _OSERROR_RESPONSE:
doReportError(new SocketIOException(
message, new OSError(error[2], error[1])));
break;
@@ -408,8 +408,10 @@ class _Socket extends _SocketBase implements Socket {
if ((offset + bytes) > buffer.length) {
throw new IndexOutOfRangeException(offset + bytes);
}
- var fastBuffer = _ensureFastAndSerializableBuffer(buffer, offset, bytes);
- var result = _writeList(fastBuffer[0], fastBuffer[1], bytes);
+ _BufferAndOffset bufferAndOffset =
+ _ensureFastAndSerializableBuffer(buffer, offset, bytes);
+ var result =
+ _writeList(bufferAndOffset.buffer, bufferAndOffset.offset, bytes);
if (result is OSError) {
_reportError(result, "Write failed");
// If writing fails we return 0 as the number of bytes and
@@ -425,7 +427,7 @@ class _Socket extends _SocketBase implements Socket {
native "Socket_WriteList";
bool _isErrorResponse(response) {
- return response is List && response[0] != _FileUtils.SUCCESS_RESPONSE;
+ return response is List && response[0] != _SUCCESS_RESPONSE;
}
bool _createConnect(String host, int port) native "Socket_CreateConnect";
« no previous file with comments | « runtime/bin/file_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698