Commit Graph

3601 Commits

Author SHA1 Message Date
whesse@google.com f40da67d2b Add Directory.createTemp() to asynchronously create a temporary directory.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1741 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-22 13:06:39 +00:00
ager@google.com 53de4bd129 Use relative path to cygwin on Windows for the runtime
build.

The DEPTH variable is apparently not stable across a 
full checkout or a checkout with only the runtime.
Review URL: http://codereview.chromium.org//8636006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1730 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-22 08:34:16 +00:00
ager@google.com 8b047a6544 Fix gclient runhooks on Windows for a full checkout.
The problem was incorrect setting of and use of the DEPTH gyp
variable.

R=whesse@google.com
BUG=496
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1706 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-21 15:47:21 +00:00
iposva@google.com deb49138ef - Build libdart as a static library. First step towards
removing dart_bin.
Review URL: http://codereview.chromium.org//8610004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1692 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-21 05:56:00 +00:00
asiva@google.com 0ce8298541 Refactor the library tag handler to share code between standalone dart and the snapshot generator.
Review URL: http://codereview.chromium.org//8549009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1665 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-18 18:24:04 +00:00
ager@google.com eb2ed9e25f Implement delete on File objects.
R=whesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1652 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-18 12:27:56 +00:00
asiva@google.com 2d88131bfe Fix prototype of Dart_Initialize.
Review URL: http://codereview.chromium.org//8574075

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1635 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-17 21:59:38 +00:00
asiva@google.com 804c3c4ace When URL mapping was specified, library loads where not being called for the URLs that were mapped.
Review URL: http://codereview.chromium.org//8588016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1632 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-17 21:26:02 +00:00
asiva@google.com 9f49e2bf74 Implement automatic loading of dart:core_native_fields library
with predefined classes having native fields.
Classes that need native fields in them can import this library and
extend these predefined classes.
Review URL: http://codereview.chromium.org//8537023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1629 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-17 21:04:43 +00:00
ager@google.com 7124c5046b Test for immutable Lists in ListSet API methods.
Using the file and socket API it was possible to modify immutable
arrays.

R=sgjesse@google.com,turnidge@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1604 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-17 06:57:39 +00:00
ager@google.com dbe72d6a24 Fix Windows build.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1574 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-16 15:53:29 +00:00
ager@google.com c4fb2b2f4d Implement setPosition on File to seek to a byte position.
R=sgjesse@google.com
BUG=dart:263
TEST=standalone/FileTest

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1573 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-16 15:50:55 +00:00
turnidge@google.com 548cced243 Provide better error messages when we fail to build the builtin lib.
Review URL: http://codereview.chromium.org//8571020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1554 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-16 00:18:03 +00:00
asiva@google.com aaffbd2561 Support command line parameters to specify a url to file name mapping. This is used during snapshot generation so that a URL is mapped to a physical file name.
Review URL: http://codereview.chromium.org//8439061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1550 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-15 21:19:27 +00:00
iposva@google.com 0c9902ca67 - Avoid allocating variable length arrays on the stack.
- Fix C++ warning about copying vtables.
- Use correct delete for PortMap entries.
Review URL: http://codereview.chromium.org//8555024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1538 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-15 17:47:21 +00:00
sgjesse@google.com 670196a286 Remove invalid assert
TBR=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1535 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-15 14:14:16 +00:00
sgjesse@google.com 04bc611751 Handle stdin/stdout/stderr on Windows
Create handle objects for stdin/stdout/stderr. For Mac OS and
Linus the file descriptor numbers are used but on Windows the
handles are wrapped in an object.

The system handles for stdin/stdout/stderr on Windows does not
support overlapped IO. To mittigate this the write calls are
performed synchronously and the read calls are preformed in a
thread which posts the result through the completion potr where
it is handled as if it originated from overlapped IO through the
completion port. For now each call to read starts a new thread.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1533 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-15 13:19:07 +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 5950638350 Better handling of stdin/stdout/stderr
When using stdout/stderr it is no longer necessary to explicitly
close the streams for the program to terminate. The automatic
close is handled by always closing the associated receive port
for write only streams when not waiting for any events. If a
close or error handler is installed for stdout/stderr these will
still keep the program alive.

For stdin better handling of the difference between sockets and
pipes have been immplemented. As a special case for stdin when
reading from a terminal the a POLLIN signal with 0 available
bytes is treated as end-of-file. This will trigger when pressing
ctrl-d in a terminal as POLLHUP is not set in that situation.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1507 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-14 14:47:58 +00:00
turnidge@google.com 8c64adf13e Deal with unhandled exceptions the same way in all Dart api functions.
--

Terminology change: invalid handles are now called error handles.

Unhandled exceptions used to be a kind of valid handle.  Now they are
a kind of error handle.

For the Dart_Invoke* functions, this means that the standard
error-checking blob drops from two tests to one test and is
harder to mess up.

Many other Dart api functions (Dart_ToString, for example) previously
dealt with unhandled exceptions by turning them into terse error
messages.  Now these functions preserve information about the
exceptions and generate better error messages.

Changed Dart_HandleMessage to return success/failure.  It seemed to fit.

--

Details:

Dart_IsValid becomes Dart_IsError (negated sense).

Dart_GetError now knows how to print a stack trace semi-nicely.

Dart_ExceptionOccurred -> Dart_IsUnhandledException.

Renamed ApiFailure class to ApiError to fit better.

ApiError now has a "data" pointer that points to either an error
message string or to an unhandled exception object.

Documentation changes aplenty.
Review URL: http://codereview.chromium.org//8501034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1470 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 19:31:04 +00:00
sgjesse@google.com 38b2b0d5d8 Provide access to stdin, stdout and stderr
R=ager@google.com, iposva@google.com

BUG=dart:402
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1456 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 11:45:53 +00:00
sgjesse@google.com 6efd258f7c Set closed for read state on a socket when indicated by the system
Without setting this state sockets would not always be closed
automatically when the input stream is read to the end and the output
stream is closed.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1406 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-10 16:35:55 +00:00
asiva@google.com e1277b840a Fix generation of pprof output.
Review URL: http://codereview.chromium.org//8497028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1367 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-09 18:59:29 +00:00
ager@google.com f789c40d85 Correct the sign of exit codes for the process library.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1356 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-09 15:37:40 +00:00
ager@google.com c7125db824 Simplify SIGCLD handler on linux and mac.
Handle all dead processes on sigal. This avoids hanging because we
missed some process terminations when they happened simultaneously.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1354 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-09 13:35:14 +00:00
ager@google.com ddc5446aa7 Avoid creating zombie processes by waiting for the terminated process.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1347 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-09 12:05:44 +00:00
ager@google.com 87c2d27fcf Reapply directory error handling change.
Refactor code to have Platform::StrError(int error_code) on all
platforms. Use that to get better error messages on Windows as well.

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1344 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-09 11:22:33 +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
ager@google.com fa2c0eca2e Revert "Post on the error handler in the Directory API when errors are encountered."
Breaks the mac build because of differences in strerror_r behavior.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1339 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-09 08:33:43 +00:00
ager@google.com 99831629bf Post on the error handler in the Directory API when errors are encountered.
Terminate the listing operation at that point.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1338 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-09 08:08:50 +00:00
turnidge@google.com 04d38885a3 Renaming:
Dart_ObjectToString -> Dart_ToString
Dart_Objects_Equal -> Dart_ObjectEquals
Dart_IsInstanceOf -> Dart_ObjectIsType
Dart_ReThrowException -> Dart_RethrowException

Added:

Dart_IsSame: === operation

Added a couple of tests.
Review URL: http://codereview.chromium.org//8490016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1326 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-08 19:18:22 +00:00
ager@google.com 0a03298fea Fix hang when opening sockets on ports that are not available.
Fix TimeoutTest to use free ports instead of using the same port
always. This does not work because tests are run in parallel and
we can have more than one instance of TimeoutTest running.

R=sgjesse@google.com,whesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1310 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-08 13:26:51 +00:00
sgjesse@google.com 37b6f2328a Fix handling of async IO from pipes on Windows
The handling of async IO on Windows wrongly casted everything to a socket connection. For named pipe based connections this caused reading of invalid memory.

Moved some of the functions to a common superclass and only call showdown for socket connections. For named pipe based connections the Dart part of the code will never send shutdown commands as named pipe based connections start out being closed in one direction and closing the other direction causes a close command.

R=ager@google.com

BUG=dart:363
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1308 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-08 13:13:26 +00:00
sgjesse@google.com 96f822068e Fix build
TBR=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1299 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-08 10:02:44 +00:00
sgjesse@google.com 4a45573956 Change the default for the len argument to writeFrom on OutputStream
Fixed a bug in the writing code as a result.

Also added copyByffer argument to one of the write methods on the OutputStream interface.

R=ager@google.com

BUG=dart:292
TEST=EchoServerStreamTest.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1293 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-08 09:42:20 +00:00
ager@google.com ec697c8481 Implementation of Platform class that exposes information about the machine and the OS.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1260 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-07 15:04:42 +00:00
sgjesse@google.com 19bab0d5d9 Fix build
TBR=whesse@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1255 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-07 14:02:22 +00:00
sgjesse@google.com 77e1072eeb Change the handling of the close event in the StringInputStream
When the underlying InputStream issues a close event keep track of
when the final string data have been read from the
StringInputStream. When all string data have been read schedule a
callback of the close event.

R=whesse@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1253 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-07 13:51:37 +00:00
ager@google.com 8a7ae17d76 Handling of wrong types of arguments in the File API.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1251 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-07 13:23:28 +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
ager@google.com 68166663f9 Renaming Array -> List in the VM API.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1195 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-04 12:25:53 +00:00
iposva@google.com 97634fb30e - Add the implementation of the Options interface to the runtime.
Review URL: http://codereview.chromium.org//8437075

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1169 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-03 21:45:03 +00:00
ager@google.com 8e714d4a4c Fix type mismatch in File.fullPathSync.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1137 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-03 10:06:55 +00:00
ager@google.com 026a56f666 Implement fullPath method on File objects.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1134 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-03 08:28:16 +00:00
mattsh@google.com 512a603600 use more distinctive pattern to mark where dart source goes
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1100 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-02 16:58:25 +00:00
ager@google.com f74ecd22fd Implemented File create API.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1095 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-02 15:57:54 +00:00
ager@google.com 3c821dbcdd Refactor async file implementation.
Use FileOperation classes instead of maps.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1088 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-02 13:53:10 +00:00
ager@google.com ba34b6eb98 Fix process test and implementation after change to setter for registering event handler.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1084 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-02 12:50:59 +00:00
ager@google.com 362d04f9af Consistently use setters to set event handlers in native APIs.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1083 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-02 12:12:43 +00:00
asiva@google.com 133894629b Fix return statement to return the right result.
Review URL: http://codereview.chromium.org//8439028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1062 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-02 01:22:40 +00:00