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

Unified Diff: runtime/bin/socket_impl.dart

Issue 8318009: Update the streams interfaces (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Starting implementation Created 9 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_impl.dart
diff --git a/runtime/bin/socket_impl.dart b/runtime/bin/socket_impl.dart
index 585a4dfd06ad78a03ac484c58b7327a0f1908ccc..1a5c8930b0785d69956613ebbd862bd19ccabbb4 100644
--- a/runtime/bin/socket_impl.dart
+++ b/runtime/bin/socket_impl.dart
@@ -41,6 +41,7 @@ class _SocketBase {
int event_mask = message[0];
for (int i = _FIRST_EVENT; i <= _LAST_EVENT; i++) {
if (((event_mask & (1 << i)) != 0) && _handlerMap[i] !== null) {
+ print("Event " + i);
var handleEvent = _handlerMap[i];
/*
* Unregister the out handler before executing it.
@@ -277,12 +278,25 @@ class _Socket extends _SocketBase implements Socket {
}
InputStream get inputStream() {
+ if (_inputStream2 != null) {
+ throw new SocketIOException("Illegal input stream use");
+ }
if (_inputStream === null) {
_inputStream = new SocketInputStream(this);
}
return _inputStream;
}
+ InputStream2 get inputStream2() {
+ if (_inputStream != null) {
+ throw new SocketIOException("Illegal input stream use");
+ }
+ if (_inputStream2 === null) {
+ _inputStream2 = new SocketInputStream2(this);
+ }
+ return _inputStream2;
+ }
+
OutputStream get outputStream() {
if (_outputStream === null) {
_outputStream = new SocketOutputStream(this);
@@ -291,6 +305,7 @@ class _Socket extends _SocketBase implements Socket {
}
SocketInputStream _inputStream;
+ SocketInputStream2 _inputStream2;
SocketOutputStream _outputStream;
}

Powered by Google App Engine
This is Rietveld 408576698