Commit Graph

3601 Commits

Author SHA1 Message Date
dgrove@google.com 7897a78551 Changes outside pkg/ and lib/ for directory refactoring
Review URL: https://codereview.chromium.org//11358024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14475 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-02 15:18:11 +00:00
lrn@google.com 7e6ae8ea09 Renaming IndexOutOfRangeException to RangeError.
It now extends ArgumentError.

Review URL: https://codereview.chromium.org//11275042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14405 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 13:46:30 +00:00
whesse@google.com f438b1881f Fix error in debug printing from the Dart executable, introduced in r14357.
BUG=

Review URL: https://codereview.chromium.org//11361032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14399 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 12:20:07 +00:00
sgjesse@google.com f38fdd42c1 Send data in an external byte array directly from the backing store
R=ager@google.com, ajohnsen@google.com

BUG=

Review URL: https://codereview.chromium.org//11275074

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14384 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 08:48:07 +00:00
asiva@google.com ebbb7c4134 - Represent strings internally in UTF-16 format, this makes it
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
2012-10-31 17:56:46 +00:00
ager@google.com 23d7b313e2 Remember to close the exitHandler when processes have received
their exit code.

R=sgjesse@google.com
BUG=

Review URL: https://codereview.chromium.org//11361008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14337 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 13:14:21 +00:00
sgjesse@google.com 27adbdd138 Start reading data from sockets directly into external byte arrays
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
2012-10-31 09:56:50 +00:00
rnystrom@google.com 908b045578 Look up executable on PATH when given environment variables.
Fixes http://code.google.com/p/dart/issues/detail?id=4402

Review URL: https://codereview.chromium.org//11260048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14300 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 18:17:51 +00:00
ajohnsen@google.com dbbf15abd8 Move ListImplementation from coreimpl to core, as a private member.
BUG=

Review URL: https://codereview.chromium.org//11189141

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14274 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 13:25:04 +00:00
ager@google.com 57d91e3cdc Use the encoding parameter for writeString on RandomAccessFile objects.
R=sgjesse@google.com
BUG=dartbug.com/6392

Review URL: https://codereview.chromium.org//11345025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14268 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 11:59:29 +00:00
ager@google.com aac030e777 Use patching for dart:io.
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
2012-10-30 10:32:30 +00:00
sgjesse@google.com b641a8d79a Add flush to HTTP output streams
The flush method was missing on the HTTP output streams and was
wrongly on the HTTP input streams. The call to flush is forwarded to
the socket output stream (on which is is actually a noop).

R=ager@google.com

BUG=dart:6384
TEST=tests/standalone/io/http_advanced_test.dart

Review URL: https://codereview.chromium.org//11301034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14246 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 08:30:05 +00:00
jmesserly@google.com b25590b4e6 "Reverting 14243"
BUG=

Review URL: https://codereview.chromium.org//11340034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14244 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 06:12:55 +00:00
jmesserly@google.com c79560e05b Fix type annotation in _FileBase._exceptionFromResponse
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
2012-10-30 05:54:12 +00:00
sgjesse@google.com db3d6358f2 Remove public SocketInputStream and SocketOutputStream clases
The socket streams only implement the streams interfaces so no
explicit classes are needed for these.

R=ager@google.com

BUG=

Review URL: https://codereview.chromium.org//11336012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14204 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 15:04:54 +00:00
sgjesse@google.com c42fe2ba7c Remove unused member
R=ager@google.com

BUG=

Review URL: https://codereview.chromium.org//11273079

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14197 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 13:20:22 +00:00
sgjesse@google.com c710ecda96 Fix spelling mistake in r14188
TBR=ager@google.com

BUG=

Review URL: https://codereview.chromium.org//11339012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14190 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 12:23:38 +00:00
sgjesse@google.com 77edd718c2 Add support for authorization of HTTP client requests
This implements the infrastructure for authorization of HTTP client
requests. Currently only basic authentication is fully implemented,
but the infrastructure to support digest is there.

Please focus on the developer facing API with the authenticate callback and
addCredentials method.

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

BUG=dart:2788
TEST=tests/standalone/io/http_auth_test.dart

Review URL: https://codereview.chromium.org//11118021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14189 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 12:13:07 +00:00
ager@google.com d166fef422 Remove file name from File C++ structure. It is not used.
Currently, the field is being assigned a string that we
immediately deallocate leaving the field invalid. Since
it is not used we should get rid of it.

R=aprelev@gmail.com,sgjesse@google.com
BUG=

Review URL: https://codereview.chromium.org//11348006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14188 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 12:02:35 +00:00
ager@google.com 83f2cfa4c1 Get rid of 'close' on process. It is very easy to use incorrectly and cut off data from your streams.
When using an interactive process started with Process.start you have
to drain the stdout and stderr streams to make sure that all resources
are freed. If you do that the dart:io library will make sure to free
all system resources for you.

R=sgjesse@google.com
BUG=

Review URL: https://codereview.chromium.org//11343009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14187 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 11:59:09 +00:00
sgjesse@google.com b40fd41222 Change the handling og the HTTP content length
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
2012-10-29 11:30:17 +00:00
floitsch@google.com 3300f91153 Make first and last getters.
Review URL: https://codereview.chromium.org//11273041

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14082 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-25 15:19:31 +00:00
floitsch@google.com e7c5e69beb Make String.charCodes a getter.
Review URL: https://codereview.chromium.org//11263040

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14078 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-25 14:25:43 +00:00
asiva@google.com 7557562b32 Fix error exit path so that it frees the buffer before exiting the program.
Review URL: https://codereview.chromium.org//11192065

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14055 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-25 00:43:17 +00:00
vsm@google.com 6ca42b35be Add crypto_android.cc
This fixes the android build of the command line embedder.

Review URL: https://codereview.chromium.org//11273018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14045 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-24 22:20:34 +00:00
floitsch@google.com 09f6d09d88 Make isEmpty a getter.
Review URL: https://codereview.chromium.org//11238035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14022 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-24 15:04:32 +00:00
lrn@google.com a083c1a108 Removed IllegalAccessException and UnsupportedOperationException.
Both were converted to StateError.

Review URL: https://codereview.chromium.org//11235054

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14012 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-24 12:36:10 +00:00
sgjesse@google.com c304bb491e Use the thread safe gethostbyname function on Linux
On Mac OS and Windows gethostbyname is already thread safe (according
to the documentation).

R=ager@google.com

BUG=

Review URL: https://codereview.chromium.org//11262006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14010 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-24 11:38:02 +00:00
ajohnsen@google.com 590413765a Moved RuntimeOptions from coreimpl to core, renamed to _OptionsImpl.
BUG=

Review URL: https://codereview.chromium.org//11260010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14004 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-24 10:34:42 +00:00
ager@google.com e18e79217d Do *not* make file handles inheritable on Windows.
This is the cause of the pub failures to unpack a file that has
just been created. The problem is that another 7-zip process has
inherited the file handle for a file that we are still writing.
When we are done writing the file, we cannot use it because the
other process still keeps the handle.

R=sgjesse@google.com,rnystrom@google.com
BUG=dartbug.com/5910

Review URL: https://codereview.chromium.org//11230051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13960 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-23 13:04:02 +00:00
ager@google.com 79a0089d38 Change Process.kill to return a boolean instead of throwing an exception when kill fails.
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
2012-10-23 12:40:53 +00:00
sgjesse@google.com 507a102246 Fix bug in r13232
Discovered after commit by floitsch@.

R=floitsch@google.com

BUG=

Review URL: https://codereview.chromium.org//11235056

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13940 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-23 09:43:49 +00:00
sgjesse@google.com 9c707dff5f Fix bug in HTTP client request generation
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
2012-10-23 09:39:17 +00:00
ager@google.com ccced31671 Change Directory.create to not fail on existing directory with that name.
The new semantics is to ensure that a directory with that name
exists. There is no way to reliably guard a create call against
existing directories in an async program.

R=sgjesse@google.com
BUG=

Review URL: https://codereview.chromium.org//11175054

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13933 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-23 09:15:01 +00:00
ager@google.com 280503fe4f Fix path to only use public interface in the implementation of methods.
This allows other people to implement the Path interface and have the
dart:io implementation interact with those Path objects.

R=sgjesse@google.com
BUG=dartbug.com/5913

Review URL: https://codereview.chromium.org//11189125

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13923 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-23 07:01:29 +00:00
ajohnsen@google.com 0ef4ef2f84 Add sessions to HttpServer.
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
2012-10-22 13:08:42 +00:00
floitsch@google.com 9074fd0178 Make hashCode a getter and not a method.
Review URL: https://codereview.chromium.org//11191078

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13866 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-22 12:41:04 +00:00
regis@google.com 8c3cfbb381 Second round of cleanups for new optional parameter semantics.
Review URL: https://codereview.chromium.org//11194025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13759 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-17 20:58:19 +00:00
justinfagnani@google.com 1dfb9473c1 Allow package: imports inside isolates
BUG=http://dartbug/5915

Review URL: https://codereview.chromium.org//11195017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13752 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-17 18:14:38 +00:00
asiva@google.com d4a7aedea4 The snapshot buffer was being released too early resulting in weird crashes.
Review URL: https://codereview.chromium.org//11193024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13749 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-17 17:47:04 +00:00
ager@google.com ff9e0f75fb Change Process.start to return a future that completes with a
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
2012-10-17 10:57:45 +00:00
asiva@google.com f8548e7142 1. Add isolate id parameter to all the debugger commands in the debugger wire protocol so that the commands are directed to the appropriate isolate.
2. Changed ddbg to pass the isolate ID in the debugger wire message.

The Dart debugger protocol document has been changed to reflect this.
Review URL: https://codereview.chromium.org//11094017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13691 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-16 18:22:54 +00:00
regis@google.com adb534674c Change core lib, dart2js, and more for new optional parameters syntax and semantics (new semantics is not enforced yet).
Review URL: https://codereview.chromium.org//11090016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13684 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-16 16:03:47 +00:00
vsm@google.com 52a2b5be7a Build fix for android
Fixes a build error following: https://code.google.com/p/dart/wiki/Android

Review URL: https://codereview.chromium.org//11099071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13681 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-16 15:36:12 +00:00
asiva@google.com b99cf58b52 Fix race condition when posting debugger messages to the message queue
(An isolate could be shutting down while a message arrives for the isolate).
Review URL: https://codereview.chromium.org//11144027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13669 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-15 21:28:36 +00:00
iposva@google.com 2eb35665a8 Fix bug 5883:
- Fix condition when removing isolates being debugged.
- Reenable debugging for Linux and Windows.
Review URL: https://codereview.chromium.org//11145023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13661 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-15 17:53:43 +00:00
sgjesse@google.com ce3583e427 Add support for multiple HTTP proxies
If the configuration returned from the findProxy in HttpClient
contails a list of proxies the the entries in the list will be tried
one by one until a working one is found. Before only the first was
ever tried.

R=ajohnsen@google.com

BUG=dart:5468
TEST=tests/standalone/io/http_proxy_test.dart

Review URL: https://codereview.chromium.org//11092044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13599 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-12 08:18:19 +00:00
fschneider@google.com 5113b2411a Remove support for generating visualizer format file for the flowgraph.
Review URL: https://codereview.chromium.org//11099061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13536 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-11 12:25:55 +00:00
iposva@google.com bc26800a4f - Generate a version string based on the VERSION file.
- Add a Dart_VersionString to the API.
- Print version string when passing --version to the standalone binary.
Review URL: https://codereview.chromium.org//11086065

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13514 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-11 07:17:09 +00:00
asiva@google.com 5737ead7e3 Add more options to the help message in verbose mode.
Review URL: https://codereview.chromium.org//11094027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13437 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-09 20:12:32 +00:00