Allow for the library tag handler to be setup for the isolate, instead of
while loading a script. This ensures that we can use #import on the boot strap libraries like builtin, uri etc.
This change results in a dart API change and corresponding modifications are
necessary in dartium and App Engine.
Review URL: https://chromiumcodereview.appspot.com//10302020
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7506 260f80e4-7a28-3924-810f-c04153c831b5
Redirection is implemented by re-using the same HttpClientConnection
object for several request/response pairs. There is s redirect method
on the HttpClientConnection object for manual redirection. The
HttpClientConnection object also has properties followRedirects and
maxRedirects to configure automatic redirect handling.
When redirection happen the HttpClientConnection will collect the
redirection history for client einspection and for redirect loop
detection.
R=ajohnsen@google.com, ager@google.com
BUG=none
TEST=tests/standalone/io/http_redirect_test.dart
Review URL: https://chromiumcodereview.appspot.com//10386024
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7415 260f80e4-7a28-3924-810f-c04153c831b5
The debugger wire handler is implemented similarly to the io event handler.
A dedicated thread monitors the debugger port for incoming connection
requests. When a debugger is connected, the VM sends events messages
over the wire and handles debugger requests.
To start the VM with a debugger connection, use the option
--debug:<portnumber>. The VM pauses at the beginning of main()
and waits for a debugger to connect.
Subsequent changes will implement debugger commands one by one.
With this change, the VM only understands "resume" commands.
Review URL: https://chromiumcodereview.appspot.com//10357003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7330 260f80e4-7a28-3924-810f-c04153c831b5
Dart strings with embedded '\0' characters cannot be faithfully
represented as a C string.
This change adds Dart_StringToBytes to the Dart API. This function
converts a Dart string to array of UTF-8 code units and returns a
length. Builtin::PrintString now calls Dart_StringToBytes instead of
Dart_StringToCString and, for I/O, fwrite is called instead of fprintf
with the string format specifier.
BUG=1098
Review URL: https://chromiumcodereview.appspot.com//10306002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7260 260f80e4-7a28-3924-810f-c04153c831b5
The web socket client is a implemented as a class which is
created from from a HTTP client connection. This way it is
independent from the HTTP client and is just using the HTTP
client.
The protocol handling is mainly re-using the code from the web
socket server.
Change the handling of setting an onNoPendingWrites handler on a
socket output stream. Now setting a new onNoPendingWrites handler
will trigger a callback when there is no pending data to be
written.
Add socket detaching to the HTTP client as well. Add the ability
to get any unparsed data read from the socket for processing
after the protocol upgrade.
R=ager@google.com, ajohnsen@google.com, vsm@google.com, jacobr@google.com
BUG=dart:2001
TEST=tests/standalone/io/web_socket_test.dart
Review URL: https://chromiumcodereview.appspot.com//10262031
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7224 260f80e4-7a28-3924-810f-c04153c831b5
The HTTP headers object in request and response objects is now marked
as non-mutable when it cannot be changed. An exception will be thrown
if trying to mutate headers when they are not mutable.
Postponed the sending of the headers until either the first byte of
body data is sent or the empty body is indicated. This is to allow
getting the output stream object and still be able to set headers
until the actual body is touched.
Added checking of the number of bytes of body data transmitted when an
explicit content length is specified.
R=ajohnsen@google.com
BUG=none
TEST=tests/standalone/src/io/HttpHeadersState.dart,tests/standalone/src/io/HttpContentLengthTest.dart
Review URL: https://chromiumcodereview.appspot.com//10232006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7010 260f80e4-7a28-3924-810f-c04153c831b5
This implements the web socket protocol as a request handler for
the HTTP server. The HTTP server have been updated with the
ability of getting the socket when a HTTP upgrade request is
processed. This way the web socket implementation is not builtin
to the HTTP server.
The API on the server is:
interface WebSocketConnection {
void set onMessage(void callback(Object message));
void set onClosed(void callback(int status, String reason));
void set onError(void callback(e));
send(Object message);
close([int status, String reason]);
}
This API currently does not have any streaming but collects the
entire message before invoking the onMessage callback. The
current browser web socket API
(http://dev.w3.org/html5/websockets/) works the same way. The
underlying web socket protocol can have unbounded messages so
long term this probably have to change. But for now the only
likely client for a web socket server is a browser.
Currently this is missing tests. The implementation has been
tested by running the WebSocketTest.dart script and connecting
using a browser. This testing have been done using Chrome 19 and
Firefox 11.
I will be adding tests in separate change lists.
The SHA-1 and base 64 code (initially written by
ajohnsen@google.com) can be removed when these algorithms is
available in the dart:crypto.
R=ager@google.com, ajohnsen@google.com, vsm@google.com, jacobr@google.com
BUG=dart:2001
TEST=none
Review URL: https://chromiumcodereview.appspot.com//10205012
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6998 260f80e4-7a28-3924-810f-c04153c831b5
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