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

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

Issue 10872033: Change getters syntax in dart:io library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« no previous file with comments | « runtime/bin/socket_impl.dart ('k') | runtime/bin/stdio.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class _SocketInputStream implements SocketInputStream { 5 class _SocketInputStream implements SocketInputStream {
6 _SocketInputStream(Socket socket) : _socket = socket { 6 _SocketInputStream(Socket socket) : _socket = socket {
7 if (_socket._id == -1) _closed = true; 7 if (_socket._id == -1) _closed = true;
8 _socket.onClosed = _onClosed; 8 _socket.onClosed = _onClosed;
9 } 9 }
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 void pipe(OutputStream output, [bool close = true]) { 48 void pipe(OutputStream output, [bool close = true]) {
49 _pipe(this, output, close: close); 49 _pipe(this, output, close: close);
50 } 50 }
51 51
52 void close() { 52 void close() {
53 if (!_closed) { 53 if (!_closed) {
54 _socket.close(); 54 _socket.close();
55 } 55 }
56 } 56 }
57 57
58 bool get closed() => _closed; 58 bool get closed => _closed;
59 59
60 void set onData(void callback()) { 60 void set onData(void callback()) {
61 _socket._onData = callback; 61 _socket._onData = callback;
62 } 62 }
63 63
64 void set onClosed(void callback()) { 64 void set onClosed(void callback()) {
65 _clientCloseHandler = callback; 65 _clientCloseHandler = callback;
66 _socket._onClosed = _onClosed; 66 _socket._onClosed = _onClosed;
67 } 67 }
68 68
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 129 }
130 } 130 }
131 131
132 void destroy() { 132 void destroy() {
133 _socket.onWrite = null; 133 _socket.onWrite = null;
134 _pendingWrites.clear(); 134 _pendingWrites.clear();
135 _socket.close(); 135 _socket.close();
136 _closed = true; 136 _closed = true;
137 } 137 }
138 138
139 bool get closed() => _closed; 139 bool get closed => _closed;
140 140
141 void set onNoPendingWrites(void callback()) { 141 void set onNoPendingWrites(void callback()) {
142 _onNoPendingWrites = callback; 142 _onNoPendingWrites = callback;
143 if (_onNoPendingWrites != null) { 143 if (_onNoPendingWrites != null) {
144 _socket._onWrite = _onWrite; 144 _socket._onWrite = _onWrite;
145 } 145 }
146 } 146 }
147 147
148 void set onClosed(void callback()) { 148 void set onClosed(void callback()) {
149 _onClosed = callback; 149 _onClosed = callback;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 214 }
215 } 215 }
216 216
217 Socket _socket; 217 Socket _socket;
218 _BufferList _pendingWrites; 218 _BufferList _pendingWrites;
219 Function _onNoPendingWrites; 219 Function _onNoPendingWrites;
220 Function _onClosed; 220 Function _onClosed;
221 bool _closing = false; 221 bool _closing = false;
222 bool _closed = false; 222 bool _closed = false;
223 } 223 }
OLDNEW
« no previous file with comments | « runtime/bin/socket_impl.dart ('k') | runtime/bin/stdio.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698