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

Unified Diff: samples/chat/http_impl.dart

Issue 8386029: Consistently use setters to set event handlers in native APIs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 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 | « runtime/bin/socket_stream.dart ('k') | tests/standalone/src/DirectoryInvalidArgumentsTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/chat/http_impl.dart
diff --git a/samples/chat/http_impl.dart b/samples/chat/http_impl.dart
index e072ac41b8ef458024287fb427aad8130b484c40..62abf7689d285a32906fada0117f02ef12dabe07 100644
--- a/samples/chat/http_impl.dart
+++ b/samples/chat/http_impl.dart
@@ -928,9 +928,9 @@ class HTTPConnectionBase {
: _sendBuffers = new Queue(),
_httpParser = new HTTPParser() {
// Register handler for socket events.
- _socket.setDataHandler(() => _dataHandler());
- _socket.setCloseHandler(() => _closeHandler());
- _socket.setErrorHandler(() => _errorHandler());
+ _socket.dataHandler = _dataHandler;
+ _socket.closeHandler = _closeHandler;
+ _socket.errorHandler = _errorHandler;
}
// Add data to be send. If the flag keepBuffer is false (the
@@ -980,7 +980,7 @@ class HTTPConnectionBase {
// If all data has been sent notify the callback.
if (_sendBuffers.isEmpty() && callback != null) {
- _socket.setWriteHandler(null);
+ _socket.writeHandler = null;
callback();
}
}
@@ -990,7 +990,7 @@ class HTTPConnectionBase {
SendBuffer buffer = _sendBuffers.first();
buffer._write(_socket);
if (!buffer._isSent) {
- _socket.setWriteHandler(continueSending);
+ _socket.writeHandler = continueSending;
break;
} else {
_sendBuffers.removeFirst();
@@ -1126,7 +1126,7 @@ class HTTPServerImplementation implements HTTPServer {
_connections = new Queue<HTTPConnection>();
_connectionsCount = 0;
_server = new ServerSocket(host, port, 5);
- _server.setConnectionHandler(connectionHandler);
+ _server.connectionHandler = connectionHandler;
}
void close() => _server.close();
« no previous file with comments | « runtime/bin/socket_stream.dart ('k') | tests/standalone/src/DirectoryInvalidArgumentsTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698