compatible with webkit and will allow for easy externalization of
strings. One byte strings are retained for pure ASCII strings.
(The language specification was changed recently to reflect this as
follows "A string is a sequence of UTF-16 code units").
- Remove four byte string class and all references to it.
- Rename some of the string functions in Dart API to make them
consistent and better describe the underlying functionality
Dart_NewString => Dart_NewStringFromCString
Dart_NewString8 => Dart_NewStringFromUTF8
Dart_NewString16 => Dart_NewStringFromUTF16
Dart_NewString32 => Dart_NewStringFromUTF32
Dart_NewExternalString8 => Dart_NewExternalUTF8String
Dart_NewExternalString16 => Dart_NewExternalUTF16String
Dart_NewExternalString32 => Dart_NewExternalUTF32String
Dart_StringGet8 => Dart_StringToUTF8
Dart_StringGet16 => Dart_StringToUTF16
Dart_StringToCString => Dart_StringToCString
Dart_IsString8 => Removed
Dart_IsString16 -> Removed
Dart_StringToBytes -> Removed
Dart_StringGet32 -> Removed
Review URL: https://codereview.chromium.org//11318018
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14357 260f80e4-7a28-3924-810f-c04153c831b5
This adds a new read function to Dart sockets which delivers data in a
system allocated buffer. For now just use that for socket input
streams.
The IOBuffer class does not do much at the moment, but the idea of
adding it is to be able to centralize the management of the IO
buffers. One thing I am considering here is to keep a cache of free
buffers which can be reused without freeing and re-allocating.
R=ager@google.com, ajhonsen@google.com
BUG=
Review URL: https://codereview.chromium.org//11338037
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14321 260f80e4-7a28-3924-810f-c04153c831b5
This allows the tools such as dartdoc to operate on dart:io
in the same way as it does with other code and allows the
implemenation of parts of dart:io for dart2js if we ever
want to do that.
The current patching is very VM specific. I have only moved
stuff to patch files when they actually need to be. For
Process and Socket everything has to be moved because they
use native fields. For the rest, only the individual native
calls have been put in patch files.
R=sgjesse@google.com,ajohnsen@google.com
BUG=
Review URL: https://codereview.chromium.org//11337019
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14259 260f80e4-7a28-3924-810f-c04153c831b5
ArgumentError is not a subtype of Exception, which leads to confusing errors in checked mode:
Expected future to complete successfully, but it failed with type 'ArgumentError' is not a subtype of type 'Exception' of 'function result'.
Stack trace:
#0 _FileBase._exceptionFromResponse (dart:io:1032:48)
#1 _RandomAccessFile.writeString.<anonymous closure> (dart:io:1491:37)
#2 _FutureImpl.transform.<anonymous closure> (bootstrap:855:37)
Review URL: https://codereview.chromium.org//11343033
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14243 260f80e4-7a28-3924-810f-c04153c831b5
This change should make the indicated HTTP message content length be
as described in RFC 2616.
For requests the content length is 0 if neither Content-Length nor
Transfer-Encoding headers are set. If the content length of a request
is set to 0 the Content-Length header is not sent with a value of
0. For GET and HEAD the content length is set to 0 by default.
For responses content length needs to be set to 0 to indicate an empty
response (unless it is a HEAD response where the content length
indicate the size of the body expected). Otherwise a body is assumed
and if no content length is set chunked transfer encoding is used.
For HTTP 1.0 chunked transfer encoding is not supported. So for HTTP
1.0 requests needs content length if they have a body and responses
without a content length will indicate end of body by closing the
connection.
R=ager@google.com
BUG=dart:6309
Review URL: https://codereview.chromium.org//11348005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14184 260f80e4-7a28-3924-810f-c04153c831b5
If the program wants to kill the process after a given time, it is
possible that the process is already dead but has not yet been
reaped. Therefore, there is no way for the programmer to test if the
process is already dead before killing it. Throwing an exception from
kill is not helpful as you will most often have to catch it and do
nothing because you cannot prevent the exception occasionally and
there is nothing you can do as a result of the exception since it
usually means that the process is already dead.
R=ahe@google.com,sgjesse@google.com
BUG=
Review URL: https://codereview.chromium.org//11238057
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13956 260f80e4-7a28-3924-810f-c04153c831b5
If an HTTP request with an empty path was done using the HttpClient
(either for normal HTTP or for upgrading to web sockets) the generated
HTTP request line was invalid. The empty path was used in the request
line e.g.
GET HTTP/1.1
instead of
GET / HTTP/1.1
This is now fixed by using / if no path is specified. This is
specified in RFC 2616 section 3.2.2.
BUG=6185
R=ager@google.com
Review URL: https://codereview.chromium.org//11231070
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13939 260f80e4-7a28-3924-810f-c04153c831b5
A session is started when HttpRequest.getSession() is called. The
session will then be added to the session manager. The session manager
then controls timeouts.
The session id is create by using the a crypto-random sequence of 16
bytes. These are extracted by using /dev/urandom on posix and
CryptGenRandom on windows.
BUG=
Review URL: https://codereview.chromium.org//11175030
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13870 260f80e4-7a28-3924-810f-c04153c831b5
Process object only when the process has been successfully started.
This is less error prone since you can use all the methods on a
Process object as soon as you can get your hands on it. Unfortunately,
this change leads to quite a few changes in test.dart. Some of those
changes will fix bugs as well. We used to have a problem with a
timeout that could fire just in between two steps in a chain of
commands that constitute one test run. This change should address
that issue as well.
BUG=dartbug.com/5305
Review URL: https://codereview.chromium.org//11091070
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13729 260f80e4-7a28-3924-810f-c04153c831b5