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

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

Issue 12328114: Rewrite the Future-pipeline from the Socket to the HttpClientRequest/HttpResponse. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add missing test file. Created 7 years, 9 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
« no previous file with comments | « no previous file | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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([String address = "127.0.0.1", 6 /* patch */ static Future<RawServerSocket> bind([String address = "127.0.0.1",
7 int port = 0, 7 int port = 0,
8 int backlog = 0]) { 8 int backlog = 0]) {
9 return _RawServerSocket.bind(address, port, backlog); 9 return _RawServerSocket.bind(address, port, backlog);
10 } 10 }
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 659
660 Future<Socket> consume(Stream<List<int>> stream) { 660 Future<Socket> consume(Stream<List<int>> stream) {
661 if (socket._raw != null) { 661 if (socket._raw != null) {
662 subscription = stream.listen((data) { 662 subscription = stream.listen((data) {
663 assert(!paused); 663 assert(!paused);
664 assert(buffer == null); 664 assert(buffer == null);
665 buffer = data; 665 buffer = data;
666 offset = 0; 666 offset = 0;
667 write(); 667 write();
668 }, 668 },
669 onError: (error) {
670 socket._consumerDone(error);
671 },
669 onDone: () { 672 onDone: () {
670 socket._consumerDone(); 673 socket._consumerDone();
671 }); 674 });
672 } 675 }
673 return socket._doneFuture; 676 return socket._doneFuture;
674 } 677 }
675 678
676 void write() { 679 void write() {
677 try { 680 try {
678 if (subscription == null) return; 681 if (subscription == null) return;
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 _raw.onBadCertificate = callback; 919 _raw.onBadCertificate = callback;
917 } 920 }
918 921
919 X509Certificate get peerCertificate { 922 X509Certificate get peerCertificate {
920 if (_raw == null) { 923 if (_raw == null) {
921 throw new StateError("peerCertificate called on destroyed SecureSocket"); 924 throw new StateError("peerCertificate called on destroyed SecureSocket");
922 } 925 }
923 return _raw.peerCertificate; 926 return _raw.peerCertificate;
924 } 927 }
925 } 928 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698