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

Unified Diff: runtime/bin/socket.dart

Issue 10938010: Switch from interfaces to abstract classes in dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Add test binaries. 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/process.dart ('k') | runtime/bin/socket_stream.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket.dart
diff --git a/runtime/bin/socket.dart b/runtime/bin/socket.dart
index 86d5e5f26537728db7f4d8e91c31dae78be5b424..83b16b288cfef5098f27d5c2967a7ce46d87c089 100644
--- a/runtime/bin/socket.dart
+++ b/runtime/bin/socket.dart
@@ -2,12 +2,14 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-interface ServerSocket default _ServerSocket {
+abstract class ServerSocket {
/**
* Constructs a new server socket, binds it to a given address and port,
* and listens on it.
*/
- ServerSocket(String bindAddress, int port, int backlog);
+ factory ServerSocket(String bindAddress, int port, int backlog) {
+ return new _ServerSocket(bindAddress, port, backlog);
+ }
/**
* The connection handler gets called when there is a new incoming
@@ -32,13 +34,13 @@ interface ServerSocket default _ServerSocket {
}
-interface Socket extends Hashable default _Socket {
+abstract class Socket implements Hashable {
/**
* Constructs a new socket and initiate connecting it to the given
* host on the given port. The returned socket is not yet connected
* but ready for registration of callbacks.
*/
- Socket(String host, int port);
+ factory Socket(String host, int port) => new _Socket(host, port);
/**
* Returns the number of received and non-read bytes in the socket that
@@ -125,7 +127,7 @@ interface Socket extends Hashable default _Socket {
* possible to read data. Calling [close] will not trigger a call to
* [onClosed].
*/
- void close([bool halfClose]);
+ void close([bool halfClose = false]);
/**
* Socket is hashable.
« no previous file with comments | « runtime/bin/process.dart ('k') | runtime/bin/socket_stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698