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

Unified Diff: runtime/bin/socket_patch.dart

Issue 14070010: Refactor Future constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added co19 issue number. Created 7 years, 8 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 | « pkg/unittest/test/unittest_test.dart ('k') | runtime/lib/deferred_load_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_patch.dart
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index 6f8e72d2471d0173b8677e89a8898e96e75a3666..bb71cc24c981a26192643b5efe87f36b2f093c76 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -115,11 +115,11 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
var socket = new _NativeSocket.listen();
var result = socket.nativeCreateBindListen(address, port, backlog);
if (result is OSError) {
- return new Future.immediateError(
+ return new Future.error(
new SocketIOException("Failed to create server socket", result));
}
if (port != 0) socket.localPort = port;
- return new Future.immediate(socket);
+ return new Future.value(socket);
}
_NativeSocket.normal() : typeFlags = TYPE_NORMAL_SOCKET {
@@ -699,7 +699,7 @@ class _SocketStreamConsumer extends StreamConsumer<List<int>> {
Future<Socket> close() {
socket._consumerDone();
- return new Future.immediate(socket);
+ return new Future.value(socket);
}
void write() {
« no previous file with comments | « pkg/unittest/test/unittest_test.dart ('k') | runtime/lib/deferred_load_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698