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

Side by Side Diff: runtime/bin/socket_patch.dart

Issue 22901017: Always initialize the EventHandler in the standalone. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Simplify impl and don't call Stop (other isolates may still be running). Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 patch class RawServerSocket { 5 patch class RawServerSocket {
6 /* patch */ static Future<RawServerSocket> bind(address, 6 /* patch */ static Future<RawServerSocket> bind(address,
7 int port, 7 int port,
8 {int backlog: 0, 8 {int backlog: 0,
9 bool v6Only: false}) { 9 bool v6Only: false}) {
10 return _RawServerSocket.bind(address, port, backlog, v6Only); 10 return _RawServerSocket.bind(address, port, backlog, v6Only);
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 address: address, 351 address: address,
352 port: port); 352 port: port);
353 } 353 }
354 if (port != 0) socket.localPort = port; 354 if (port != 0) socket.localPort = port;
355 return socket; 355 return socket;
356 }); 356 });
357 } 357 }
358 358
359 _NativeSocket.normal() : typeFlags = TYPE_NORMAL_SOCKET { 359 _NativeSocket.normal() : typeFlags = TYPE_NORMAL_SOCKET {
360 eventHandlers = new List(EVENT_COUNT + 1); 360 eventHandlers = new List(EVENT_COUNT + 1);
361 _EventHandler._start();
362 } 361 }
363 362
364 _NativeSocket.listen() : typeFlags = TYPE_LISTENING_SOCKET { 363 _NativeSocket.listen() : typeFlags = TYPE_LISTENING_SOCKET {
365 eventHandlers = new List(EVENT_COUNT + 1); 364 eventHandlers = new List(EVENT_COUNT + 1);
366 _EventHandler._start();
367 } 365 }
368 366
369 _NativeSocket.pipe() : typeFlags = TYPE_PIPE { 367 _NativeSocket.pipe() : typeFlags = TYPE_PIPE {
370 eventHandlers = new List(EVENT_COUNT + 1); 368 eventHandlers = new List(EVENT_COUNT + 1);
371 _EventHandler._start();
372 } 369 }
373 370
374 int available() { 371 int available() {
375 if (isClosing || isClosed) return 0; 372 if (isClosing || isClosed) return 0;
376 var result = nativeAvailable(); 373 var result = nativeAvailable();
377 if (result is OSError) { 374 if (result is OSError) {
378 reportError(result, "Available failed"); 375 reportError(result, "Available failed");
379 return 0; 376 return 0;
380 } else { 377 } else {
381 return result; 378 return result;
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 if (_detachReady != null) { 1217 if (_detachReady != null) {
1221 _detachReady.complete(null); 1218 _detachReady.complete(null);
1222 } else { 1219 } else {
1223 if (_raw != null) { 1220 if (_raw != null) {
1224 _raw.shutdown(SocketDirection.SEND); 1221 _raw.shutdown(SocketDirection.SEND);
1225 _disableWriteEvent(); 1222 _disableWriteEvent();
1226 } 1223 }
1227 } 1224 }
1228 } 1225 }
1229 } 1226 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698