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

Unified Diff: runtime/bin/socket_patch.dart

Issue 11337019: Use patching for dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 8 years, 2 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: runtime/bin/socket_patch.dart
diff --git a/runtime/bin/socket_impl.dart b/runtime/bin/socket_patch.dart
similarity index 97%
rename from runtime/bin/socket_impl.dart
rename to runtime/bin/socket_patch.dart
index 8594afaef0b5eda58f2d2ec2d32a902dc4cf9b7e..490cca5b84ad52593f34f1ce1b33dfb134189c76 100644
--- a/runtime/bin/socket_impl.dart
+++ b/runtime/bin/socket_patch.dart
@@ -2,6 +2,17 @@
// 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.
+patch class ServerSocket {
+ /* patch */ factory ServerSocket(String bindAddress, int port, int backlog) {
+ return new _ServerSocket(bindAddress, port, backlog);
+ }
+}
+
+
+patch class Socket {
+ /* patch */ factory Socket(String host, int port) => new _Socket(host, port);
+}
+
class _SocketBase extends NativeFieldWrapperClass1 {
// Bit flags used when communicating between the eventhandler and
@@ -97,6 +108,7 @@ class _SocketBase extends NativeFieldWrapperClass1 {
}
OSError _getError() native "Socket_GetError";
+
int _getPort() native "Socket_GetPort";
void set onError(void callback(e)) {
@@ -423,8 +435,7 @@ class _Socket extends _SocketBase implements Socket {
throw new SocketIOException("writeList failed - invalid socket handle");
}
- _writeList(List<int> buffer, int offset, int bytes)
- native "Socket_WriteList";
+ _writeList(List<int> buffer, int offset, int bytes) native "Socket_WriteList";
bool _isErrorResponse(response) {
return response is List && response[0] != _SUCCESS_RESPONSE;

Powered by Google App Engine
This is Rietveld 408576698