Commit Graph

28 Commits

Author SHA1 Message Date
whesse@google.com ed4b91dc18 Revert "Revert "Fix dartdoc block code comments in Dart API that are broken and use [: :] delimiters.""
This reverts the reversion of 10368.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10373 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 09:09:13 +00:00
whesse@google.com 87ed218f2c Revert "Fix dartdoc block code comments in Dart API that are broken and use [: :] delimiters."
This reverts commit 10368.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10370 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 08:48:29 +00:00
whesse@google.com f03f271148 Fix dartdoc block code comments in Dart API that are broken and use [: :] delimiters.
BUG=dart:2570

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10368 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 08:16:39 +00:00
ager@google.com b876387df2 Remove reference to non-existing classes from encodings class comment.
R=whesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9060 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-25 12:10:02 +00:00
sgjesse@google.com 33565cd64a Change the error handling in dart:io
1. Change the argument on all onError handlers from Exception to
Dynamic

2. Throw an exception if an error ocours and there is no error handler
present for handling it.

For sockets there is the complication that an error on a socket is
reported to the socket error handler, and each of the stream error
handlers. The solution to this is to throw an exception if there was
no error handler on either the socket or one of the streams.

Fixed a number of bugs in tests revealed by errors no longer being
silently ignored.

R=ager@google.com

BUG=none
TEST=tests/standalone/src/io/*

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6994 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-26 08:12:17 +00:00
sgjesse@google.com 7fa9f1fe88 Add error handling to socket streams
Change the streams onError callbacks to get an Exception argument on
all streams.

Added actual error handling to the socket streams.

As it is difficult to determine where an error should be reported I
decided to call all the registered onError callbacks, that is on the
socket itself and on both input and output stream.

Did some additional cleanup of the naming of OnError argument in some tests.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5717 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-21 14:40:15 +00:00
sgjesse@google.com 4f1ac7c8c6 Prevent creation of additional FileMode and Encoding objects
R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5234 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-09 14:02:58 +00:00
sgjesse@google.com 4491ea144d Add writeString method to OutputStream
All output streams now supports writeString which takes the encoding
to be used when transforming the string into a sequence of bytes.

This change also introduces an Encoding interface and Encodings class
as a repository for the supported encodings. Currently this is only
UTF-8, ISO-8859-1 and ASCII. All methods in dart:io which previously
used a String to represent the encoding now uses objects implementing
Encoding.

In this change dart:io is still using the internal UTF-8 encoder used
by the HTTP implementation. I will look into using the one in dart:utf
in a separate change.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5231 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-09 13:49:20 +00:00
sgjesse@google.com ac12107c2f Add method available to StringInputStream
The StringInputStream did not have any way for checking the number of
available characters. Added method available like on a binary
InputStream.

R=ager@google.com

BUG=dart:1945
TEST=tests/standalone/src/io/StringStreamTest.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5021 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-06 12:42:30 +00:00
ager@google.com 242bba108b Reapply dart:io API changes.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4790 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 10:07:35 +00:00
ager@google.com fd31551ca4 Revert "Rename blahHandler to onBlah throughout dart:io."
D'oh! I need to update the test binaries as well. Reverting, building
and putting back in again.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4785 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 09:43:15 +00:00
ager@google.com 40e0bceab5 Rename blahHandler to onBlah throughout dart:io.
Additionally, change all single-shot methods to take their callback as an argument instead of registering it on the object.

I have attempted to find all uses in the repo but there might
be some firefighting to do when this lands.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4784 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 09:36:04 +00:00
ager@google.com 4605b5ea33 Minor changes to the dart:io library files.
- Split some of the streams into an interface and an implementation file.
- Add documentation comments where missing.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3616 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-26 10:03:19 +00:00
ricow@google.com 45b5e07fa9 Fix a few nits in comments in input_stream.dart
Review URL: http://codereview.chromium.org//9155007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3137 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-10 12:42:02 +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
iposva@google.com 5b509684e3 - Fix outdated use of factory clause.
- Update error messages.
Review URL: http://codereview.chromium.org//8949043

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2707 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-21 17:26:02 +00:00
sgjesse@google.com 3ebb36c77f Implement list based output stream and add pipe to list based input streams
R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2641 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-20 16:03:29 +00:00
sgjesse@google.com 0a3bf1c3eb Add pipe to input stream
Using the pipe method the data from an input stream can be piped
directly to an output stream.

R=whesse@google.com, ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2564 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-19 09:14:19 +00:00
sgjesse@google.com 5b74b0065a Update comments for streams
R=whesse@google.com, ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2426 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-14 13:41:35 +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
sgjesse@google.com 775438288d Add line handler to string stream
This adds the line handler to the string stream to provide callbacks
when a line is known to be available.

This change also refactors parts of the string stream to avoid
converting decoded char codes to a string before checking for line
break sequences. With this change the string decoder tracks all line
breaks.

There is still room for improvement as e.g. the coping of the list of
char codes when reading lines can be avoided by using anoher offset.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2016 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-02 11:59:02 +00:00
hausner@google.com 45fff0023d Undo some of the initializing formal change 1755
I didn't undo those initializing formas that are initializing a private field.
Review URL: http://codereview.chromium.org//8677027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1824 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 23:44:14 +00:00
hausner@google.com b9cf297c15 Initializing formals can't be optional parameters
Add new error message to VM compiler.
Remove all optional initializing formals from library
and tests.
Review URL: http://codereview.chromium.org//8619008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1755 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-22 19:09:54 +00:00
sgjesse@google.com a0d0bd8899 Rephrase some comments.
R=whesse@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1532 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-15 12:41:14 +00:00
sgjesse@google.com 516d71ab0b Change the handling of closing sockets
Sockets now supports being half-closed for either reading or writing. When a socket is closed it is by default closed for both read and write and the underlying file descriptor is destroyed. However the socket close can be asked to only half-close the socket to send end of stream to the other end and still have the ability to receive more data.

The close event on a socket is only emitted when the socket is closed by the other end. Both half-close and full-close by the other end is reported as a close event. If a socket is already half closed the close event will automatically destroy the socket.

The streams on the sockets also takes advantage of this. A socket input stream will report a close event when the other end closed. A socket output stream will half-close the socket when close is called making it possible to still receive data on the input stream. When both streams have been closed the socket is destroyed.

For sockets operating on pipes they are initially created as half-closed for either reading or writing depending on which type of pipe a socket object is based on. A pipe for writing will start half-closed for reading so if it is only half-closed for writing the socket will still be destroyed. Same with a pipe for reading that will start half-closed for writing and when a close event is received half-closing the other direction will destroy the socket. Socket objects based on pipes are only exposed through streams.

Extended the socket close test to test a number of different scenarios.

Also refactor the socket data C++ object to encapsulate more socket information and operations.

Now the Linux and Mac OS versions are 100% the same as it turned out that using POLLRDHUP on Linux was not required any more.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1196 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-04 12:34:43 +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
sgjesse@google.com 6abaad8aa1 Restructured socket tests and fixed readUntil on InputStream
Most of the socket tests where written with closing both the server and client ends of the socket. However on Windows this can lead to errors once in a while (WSAECONNRESET). The tests now closes the socket in the client and and waits for a close event on the server side.

The readUntil on InputStream did not take data in the internal buffer into account. This has been fixed and the related test have been rewritten to check for two patterns which together will match all the input.

R=ager@google.com

BUG=
TEST=

Review URL: https://chromereviews.googleplex.com/3536016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@126 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-06 14:47:49 +00:00
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00