Commit Graph

5 Commits

Author SHA1 Message Date
sgjesse@google.com d7c1a2835f Prepare the HTTP library for inclusion in the standalone VM (step 2)
Change the handling of the received data on HTTPRequest and
HTTPClientResponse to use the InputStream interface instead of
dataReceived and dataEnd handlers.

We should probably do something to make the following serer side and
client side patterns simpler:

void handler(HTTPRequest request, HTTPResponse response) {
  ...
  StringBuffer body = new StringBuffer();
  StringInputStream input = new StringInputStream(request.inputStream);
  input.dataHandler = () => body.add(input.read());
  input.closeHandler = () {
    String data = body.toString();
    ...
  }
}

HTTPClientConnection conn = ...
  conn.responseHandler = (HTTPClientResponse r) {
  ...
  StringBuffer body = new StringBuffer();
  StringInputStream input = new StringInputStream(request.inputStream);
  input.dataHandler = () => body.add(input.read());
  input.closeHandler = () {
    String data = body.toString();
    ...
  }
}

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

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4679 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 13:04:04 +00:00
ajohnsen@google.com 143de9eb80 Use ByteArray's native for Socket and File.
Review URL: https://chromiumcodereview.appspot.com//9235067

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3812 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 21:48:27 +00:00
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 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 841221a47d Merge the two buffer list implementations
R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1342 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-09 10:52:20 +00:00