Commit Graph

818 Commits

Author SHA1 Message Date
whesse@google.com 8929d6c037 dart:io | Fix a crash when read was called on a closed socket on Windows.
BUG=dartbug.com/8798

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19396 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-04 16:16:18 +00:00
tball@google.com d052192580 Set vmstats socket as blocking.
Review URL: https://codereview.chromium.org//12390041

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19345 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-01 23:38:45 +00:00
tball@google.com ca8b23183b Added Socket::SetBlocking() and Socket::SetNonBlocking().
Review URL: https://codereview.chromium.org//12380032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19334 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-01 18:33:17 +00:00
ajohnsen@google.com ba01a8ecfc Fix socket so we stop the consumer before we close the socket - this makes sure we socket-close future don't result in a socket write.
BUG=https://code.google.com/p/dart/issues/detail?id=8874

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19316 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-01 14:20:38 +00:00
sgjesse@google.com 7d6ddd4ae9 Remove wrong type annotation
nativeCreateConnect returns either a bool (only true) or an OSError.

TBR=ajohnsen@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19276 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-01 07:53:11 +00:00
ajohnsen@google.com b6f9a3e395 Correctly close done future with an error, before a normal complete can happen.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19229 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-28 14:16:05 +00:00
floitsch@google.com 51212d24ed Remove deprecated ms arguments for Timer and Future.
Review URL: https://codereview.chromium.org//12342014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19220 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-28 13:24:12 +00:00
whesse@google.com a3bf390d80 dart:io | Change a remaining use of File.name to File.path, in samples.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19150 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 16:15:18 +00:00
sgjesse@google.com a1ffe8a451 Make File.readSync return only the bytes read
R=ager@google.com
BUG=https://code.google.com/p/dart/issues/detail?id=8831
TEST=tests/standalone/io/file_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19145 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 15:33:08 +00:00
whesse@google.com 6ef35edef1 dart:io | Rename File.name to File.path.
BUG=dartbug.com/8790

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19144 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 15:26:11 +00:00
ajohnsen@google.com f5ade02146 Make sure the socket unsubscribes on error, so we don't get race conditions between an error and an immidiately following close event.
This makes sure we always see the expected errors.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19117 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 09:27:01 +00:00
lrn@google.com 6b4f4b1bab Change new List(n) to return fixed length list.
Deprecate List.fixedLength, add List.filled.

Make Iterable.toList and List.from take "growable" argument,
defaulting to false.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19112 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 08:45:04 +00:00
ajohnsen@google.com 7912f3f1bd Rewrite the Future-pipeline from the Socket to the HttpClientRequest/HttpResponse.
Before we had two future, HttpClientRequest/HttpResponse.done and
Socket.addStream's return valud(stored as _writeDoneFuture in
    http_impl). Many issues in our code was based on the futures not
being the same, that the user will get a done event, while the socket is
still writing data on the socket.

Immidiate calls to HttpServer/HttpClient.close, after e.g. pipe, would
then destroy the socket while still having data in dart buffers.

The new approach makes sure that there is a direct future link between
the socket and the user.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19111 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 08:27:12 +00:00
asiva@google.com 154d51dbb7 Quick fix for racy shutdown issues in VmStats.
(We need a VmStats::InitOnce to set things up).
Review URL: https://codereview.chromium.org//12316148

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19106 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 02:25:32 +00:00
tball@google.com 9cf8937ec8 Don't execute VmStats::Stop() unless port is specified.
Review URL: https://codereview.chromium.org//12310158

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19105 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 01:09:36 +00:00
tball@google.com 8dc6a3764a Removed remaining reference to FDUtils.
Review URL: https://codereview.chromium.org//12328124

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19100 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 00:25:08 +00:00
tball@google.com 6a43e276e8 Used Socket::Read instead of FdUtils::ReadFromBlocking, since FdUtils
isn't implemented on Windows.
Review URL: https://codereview.chromium.org//12328122

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19098 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-26 23:40:26 +00:00
tball@google.com 1b1cb1b750 Replaced read() call with FDUtils functions to fix Windows build.
Review URL: https://codereview.chromium.org//12340090

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19095 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-26 23:22:53 +00:00
iposva@google.com 98a0b91582 - Fix string formatting.
Review URL: https://codereview.chromium.org//12340088

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19093 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-26 23:02:40 +00:00
tball@google.com 4c4482e4c7 Initial prototype of vmstats support, based on Dart VM Stats draft design doc.
Review URL: https://codereview.chromium.org//12221022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19091 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-26 22:34:08 +00:00
iposva@google.com b564104ea5 - Properly load the core libraries as libraries and not as scripts.
This will honor their imports and library names.
Review URL: https://codereview.chromium.org//12321082

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19017 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 23:25:29 +00:00
whesse@google.com 77a1a0c56a dart:io | Fix writing to a Socket while and after calling destroy() on it.
BUG=dartbug.com/8681
TEST=standalone/io/http_client_request_test

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18969 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 14:52:39 +00:00
lrn@google.com 3c0ac360e7 Remove deprecated string features.
Make String.codeUnits return a List.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18960 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 10:48:09 +00:00
ajohnsen@google.com 04cc4cc2a5 Add asserts to kqueue filter/events on mac.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18880 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-22 11:51:24 +00:00
ajohnsen@google.com 03ac5fcaf2 Handle single EPOLLHUP epoll events on Linux.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18878 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-22 11:42:32 +00:00
ajohnsen@google.com 167394115a Don't send null data events on a Socket stream.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18877 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-22 11:24:35 +00:00
ajohnsen@google.com 5068d80262 Handle legacy epoll event on Linux.
This should fix flaky tests on older versions of Linux (including those
    running buildbot).

Also re-enable test on linux.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18873 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-22 09:51:08 +00:00
asiva@google.com 97ef3c86d3 Move json, uri, utf and crypto libraries into the VM.
This should ensure that we would not need a patch per embedder for these libraries in case somebody decides to patch these.
Review URL: https://codereview.chromium.org//12318031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18865 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-22 01:24:57 +00:00
asiva@google.com f930e3856b Add typed data interface to Dart API, this only changes the C++ API as dicussed in a previous email. The dart code in the library has not been changed yet.
Review URL: https://codereview.chromium.org//12255018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18846 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 18:43:44 +00:00
sgjesse@google.com a7f2f94695 Add missing files from previous commit
TBR=ager@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18821 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 12:08:34 +00:00
sgjesse@google.com 488b016a2f Merge IO v2 branch to bleeding edge
R=ager@google.com, ajohnsen@google.com, whesse@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18820 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 11:58:11 +00:00
iposva@google.com 36d72ffdcc Fix Windows build:
- Missed a OS dependent file.
Review URL: https://codereview.chromium.org//12315020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18798 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-20 23:47:29 +00:00
iposva@google.com b1c855488b - Attempt to fix build breakage on Windows.
Review URL: https://codereview.chromium.org//12319030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18788 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-20 21:27:07 +00:00
iposva@google.com 9046a44a37 Prepare for removal of source_filter.gypi:
- Guard OS-dependent source files with #if TARGET_OS_* in a similar
  fashion to the architecture dependent sources.
Review URL: https://codereview.chromium.org//12282051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18786 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-20 21:17:38 +00:00
whesse@google.com f15afd86b2 dart:io Directory.list: Fix use of snprintf return value to work with both C99, Windows, and pre-C99 versions of snprintf.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18754 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-20 13:34:50 +00:00
whesse@google.com a2bd479106 IO v2: Use a single PathBuffer in Directory.list on Windows, and stop rewriting paths during listing.
Review URL: https://codereview.chromium.org//12212194

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18740 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-20 09:42:28 +00:00
whesse@google.com 25e5ba7f5f Change Directory.list to use the input path, and not resolve it to a full path.
All paths reported by Directory.list are now extensions of the input path.

The Windows platform equivalent change will be committed in a separate CL.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18739 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-20 09:27:08 +00:00
iposva@google.com 826acfc074 - Avoid warnings when the result of TEMP_FAILURE_RETRY is unused.
Review URL: https://codereview.chromium.org//12178025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18732 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-19 22:43:22 +00:00
whesse@google.com c22c9cc9b0 Fix error handling in SecureSocket.initialize
BUG=dartbug.com/8228
TEST=standalone/io/secure_socket_arguments_test

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18702 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-19 17:00:35 +00:00
tball@google.com a852a76e3f Last windows fix (hopefully!).
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18599 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 21:06:54 +00:00
tball@google.com 34d2808cc8 Fixed Windows compile error.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18598 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 21:02:31 +00:00
tball@google.com fe80553fdd Moved GetCurrentTime functions from bin/eventhandler to bin/utils.
Review URL: https://codereview.chromium.org//12280004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18597 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 20:51:49 +00:00
whesse@google.com acd03abf83 dart:io: Use PathBuffer class for Directory.list on Windows platform.
BUG=https://code.google.com/p/dart/issues/detail?id=7505

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18448 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 15:00:55 +00:00
asiva@google.com 067b8ba92c Add snapshot size to the VM benchmarks suite.
Review URL: https://codereview.chromium.org//12226068

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18367 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 02:39:00 +00:00
whesse@google.com a0461f958d Remove erroneous assert from Windows implementation of dart:io File.fullPath.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18307 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-11 13:44:00 +00:00
whesse@google.com 1a4082724c Revert changes to directory listing on Windows, to diagnose pub problems.
TBR=nweiz@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18260 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-08 16:47:33 +00:00
whesse@google.com fa78161fbf Remove use of strnlen on Mac OS, because pre-Lion versions don't have it.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18251 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-08 12:55:32 +00:00
whesse@google.com 45e351e689 Add string.h header file to directory listing implementations.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18248 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-08 12:21:56 +00:00
whesse@google.com 58e8b94008 Use a PathBuffer class in dart:io directory lister.
This simplifies the code, and avoids buffer overflow errors
by encapsulating snprintf.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18247 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-08 11:58:12 +00:00
tball@google.com 898ec7731f Added Socket::Close() function.
Review URL: https://codereview.chromium.org//12209047

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18199 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-07 00:44:55 +00:00