Commit Graph

9 Commits

Author SHA1 Message Date
ager@google.com 4efd1f98fa Split dart:builtin into dart:builtin and dart:io.
- dart:builtin is implicitly imported.
- dart:io has to be explicitly imported.

I will update the macos and windows stable test binaries when we
are happy with the solution.

R=iposva@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9254026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3537 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-24 07:36:59 +00:00
sgjesse@google.com 8055ffeb77 Add close to input stream and cleanup socket and streams
* All input streams now have a close method for just cutting
  the stream
* Removed interfaces FileInputStream and FileOutputStream
* Added exceptions to socket to avoid mixing stream and non-stream
  use of the same socket
* Added special handling of the socket connect handler callback

R=ager@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//9029001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2893 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-02 13:00:59 +00:00
sgjesse@google.com 8f1b82458f Improve the event handling for string input stream
1. The string input stream now calls the data or line handler if there
   is still data available after returning from the data or line
   handler. These callbacks are scheduled on the event loop.

2. The reading of data is now throtteld so that calls to read or
   readLine will not eagerly try to read from the wrapped input
   stream. After each call to read the data handler is installed if
   no more buffered data is available. Also when the data handler
   is called the data handler on the wrapped input stream is
   un-installed if no more data is required for the current data or
   line handler.

One side effect of this change is that just reading from an input
stream obtained from a file is no longer possible. One will have to
set up a data handler callback of some kind before any calls to read
will return data. We can of cause change this to allow synchronous
usage of an input stream obtained from a file (maybe with an optional
argument to openInputStream).

Fixed a related throtteling issue with the chunked input stream.

R=ager@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//8885032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2310 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-09 14:08:47 +00:00
ager@google.com 64ca753193 Split File into File and RandomAccessFile.
Update all users of the API.

R=sgjesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8883017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2272 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-08 19:37:17 +00:00
sgjesse@google.com 3d8e19a43f Simulate data and close callbacks on a synchronous file input stream
A input stream obtained from File.openInputStream() can now be used
with code that expects data and close callbacks.

Before the input stream obtained from File.openInputStream() did not
generate any callbacks.

R=ager@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//8819021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2166 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-07 08:57:31 +00:00
sgjesse@google.com 731e8d91af Add chunked input stream
The chunked input stream can deliver data fron an input stream as
fixed sized blocks of data.

R=ager@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//8818009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2163 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-07 08:00:19 +00:00
ager@google.com d864b5e1f6 First round of changes to the file interface.
Have both async and sync version for the file operations. The
thinking is that once you have used an async operation you will
not be allowed to use a sync one. Only sync versions currently
implemented.

Instead of having one input and one output stream associated with a
file we create new streams whenever needed. These get their own
underlying file descriptor so they do not interfere. This means
that FileStreams have to be explicitly closed.

R=sgjesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8399033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@819 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-27 13:33:18 +00:00
sgjesse@google.com 00a00bcdb4 This contains a new InputStream and StringInputStream interfaces.
The readUntil is only supported through readLine on the StringInputStream.

The StringInputStream implementation in string_stream.dart could live outside the VM as it is plain Dart code.

BUG=
TEST=

Review URL: http://codereview.chromium.org//8318009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@747 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-26 13:17:28 +00:00
ngeoffray@google.com 76ef8258a4 Create a standalone test directory and move tests in runtime/tests/dart (mostly) to that directory.
Review URL: http://codereview.chromium.org//8261009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@393 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-13 12:44:29 +00:00