Commit Graph

3172 Commits

Author SHA1 Message Date
whesse@google.com 91deb19914 dart:io | Enable multithreaded secure networking encryption.
BUG=
R=ajohnsen@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24233 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 15:06:43 +00:00
ajohnsen@google.com ff7d45d16f Always escape " in Process on Windows.
BUG=https://code.google.com/p/dart/issues/detail?id=10895
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24232 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 14:50:33 +00:00
zra@google.com 4c0268f31e Removes references to LIB_DIR from gyp files.
This eliminates the cirular dependency warnings from make.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24206 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-19 22:33:57 +00:00
sgjesse@google.com 54f6939ffc Ensure that there is no "hidden" DNS lookup in secure socket code
The required setting of the internet adddress of the peer for NSS is
now using the internet address which have already been looked up in
Dart code for normal secure socket connect.

In the cases where SecureSocket.secure and RawSecureSocket.secure is
used with a host name, the internet address of the already connected
socket will be used. If that is not sufficient an IntetnetAddress from
DNS lookup in Dart can be passed instead of just a host name.

R=ajohnsen@google.com, whesse@google.com
BUG=http://dartbug.com/11103

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24174 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-19 09:07:43 +00:00
johnmccutchan@google.com 2cf19138e3 HTTP loading cleanups
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24165 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-19 00:02:38 +00:00
iposva@google.com 55f0303ff3 - Fix PATH_MAX vs MAX_PATH confusion.
Review URL: https://codereview.chromium.org//17190005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24150 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-18 16:24:20 +00:00
iposva@google.com 7769854d0d - Do NOT mix malloc/free and new/delete!
R=sgjesse@google.com, sigmund@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24145 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-18 15:44:21 +00:00
johnmccutchan@google.com e93ba804c4 Revert 24099
Review URL: https://codereview.chromium.org//17284004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24100 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-17 16:38:17 +00:00
johnmccutchan@google.com 5103b96715 Make implicit things explicit when loading scripts.
Explicitly:
Set current working directory
Set windows flag

Previously these were side effects of calling other functions.

Also use ' strings consistently.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24099 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-17 15:59:13 +00:00
ajohnsen@google.com 1f449fd355 Report async errors when they happend, in directory listing.
This ensure that we capture the correct OS error.

Also fix compiler issue for mac and dart2js.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24076 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-17 08:16:42 +00:00
ajohnsen@google.com 69f44acd72 Use correct keyword for forward-declaration in directory.h.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24075 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-17 07:31:46 +00:00
ajohnsen@google.com 1b83d3b52e Make Directory.list pull-based, making it possible to pause, resume and cancel directory listing.
BUG=https://code.google.com/p/dart/issues/detail?id=10163,
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24074 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-17 07:27:19 +00:00
asiva@google.com 51651ee00b Split dart_api.h into multiple parts:
dart_api.h - Has the core API functions
dart_mirrors_api.h - Has API functions to support Mirrors or reflection
dart_native_api.h - Has parts which support the native message handling,
                    profilling and other internal tools

R=sgjesse@google.com, vsm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24062 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 23:47:40 +00:00
sgjesse@google.com 7ce40aa3a0 dart:io | Add File.rename
R=ajohnsen@google.com
BUG=

Committed: https://code.google.com/p/dart/source/detail?r=24029

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24030 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 13:34:54 +00:00
sgjesse@google.com 000875ca45 dart:io | Add File.rename
R=ajohnsen@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24029 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 12:58:21 +00:00
sgjesse@google.com 0cd11fcdc3 Remove Encoding.BINARY
THe Encoding.BINARY was a bad idea. It is now removed and null is used to indicate binary result from Process.run.

R=ajohnsen@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23977 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 13:06:11 +00:00
sgjesse@google.com c2d41fb1ba Add support for binary stdout/stderr data when using Process.run
R=ajohnsen@google.com
BUG=http://dartbug.com/9167

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23962 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 10:27:54 +00:00
sgjesse@google.com 55709f1f43 Ensure that only byte values are sent by sockets and web sockets
R=ajohnsen@google.com
BUG=http://dartbug.com/11007

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23896 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-12 08:33:16 +00:00
ajohnsen@google.com 5ce3b9ddea Clean up dart:io exceptions.
- Introduce IOException.
- Remove HttpParserException.
- Merge RedirectLimitExceededException and RedirectLoopException into
RedirectException.
- Remove 'IO' from FileIOException, DirectoryIOException, LinkIOException
and SocketIOException.

BUG=https://code.google.com/p/dart/issues/detail?id=9955
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23848 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 13:15:46 +00:00
ajohnsen@google.com 8bd584804b Require exact match of vm arguments.
This will make sure e.g. '--verbose-gc' won't trigger '--verbose'.

BUG=
R=iposva@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23845 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 11:55:43 +00:00
ajohnsen@google.com 2149b3a859 Add 'Server' and 'User-Agent' default header fields.
They include the major and minor version of Dart.

BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23844 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 11:54:15 +00:00
asiva@google.com a12382dc22 Fix for issue 11112 align flags to formats used by other tools.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23831 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-10 21:57:49 +00:00
johnmccutchan@google.com 3c69367fb7 HTTP loading tests and package root support
R=asiva@google.com, iposva@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23593 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-04 13:52:47 +00:00
whesse@google.com 7244fff5b4 dart:io | Improve NSS and SSL error messages for secure networking.
BUG=dartbug.com/9688
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23586 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-04 11:06:00 +00:00
lrn@google.com 662c2a8262 Rename RuntimeError to CyclicIntializationError, as per spec.
The RuntimeError has been used to report cyclic initialization errors in
dart2js.
It has also been used for other, unrelated, uses, where it makes
little to no sense.

The RuntimeError type has been removed, but added in js_helper.dart,
where dart2js uses it.

Uses of new RuntimeError("some message") have been converted to
other errors (Argument/State/Unsupported). In some cases, just
throwing a String might have been just as good.

BUG=http://dartbug.com/11040
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23584 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-04 10:33:11 +00:00
johnmccutchan@google.com 738b05471d Fix HTTP response handling
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23565 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-03 20:32:12 +00:00
whesse@google.com 9c6d3b86e4 dart:io | Make FileStat.stat throw an exception when the file does not exist, or cannot be accessed.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23543 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-03 15:01:02 +00:00
kustermann@google.com ba62bae621 Fix for leaking file descriptor issue
When calling a non-existent executable, a pair of file descriptors will be
created with pipe(). One end goes to the exitcode handler thread, the other end
goes to the epoll() thread.

If an error occurs during process creation, the pipe is still created and the
exit handler thread writes the exitcode to the pipe, but the other file
descriptor is not added to the epoll() set and is therefore leaked. (i.e.
Process_Start ignores the other end of the pipe if exec() failed in
Proces::Start()).

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23534 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-03 09:41:36 +00:00
whesse@google.com 91c8cd03a3 Clean up the gyp build of standalone dart executable on Android.
BUG=
R=iposva@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23531 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-03 09:19:31 +00:00
asiva@google.com dcfbe9ce9b Fix windows build.
Review URL: https://codereview.chromium.org//15881009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23504 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 23:01:35 +00:00
iposva@google.com b49896cf86 - Another speculative fix for Windows.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23500 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 22:43:17 +00:00
iposva@google.com cb9bd8666e - Fix Windows.
Review URL: https://codereview.chromium.org//16105019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23499 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 22:33:34 +00:00
johnmccutchan@google.com 43425cc7c7 Remove hack http client and use the one in dart:io
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23496 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 22:04:59 +00:00
iposva@google.com 95692ea5d6 - Attempt not to pass C++ flags to C builds.
Review URL: https://codereview.chromium.org//15736026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23480 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 17:32:12 +00:00
iposva@google.com 1836035266 - Modify dart_api.h to be a proper C API.
- Verify that dart_api.h can be used from C
  by changing the test_extension to be a pure C file.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23476 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 16:36:27 +00:00
lrn@google.com faa7227cec Make new StreamController be async by default.
Change all instances, except some tests, to be sync still.
Rename Multiplex to Broadcast everywhere.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23453 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 06:07:39 +00:00
iposva@google.com b60d09b1fb - Add different types for persistent and weak persistent handles
in the Dart C API.
- Adapt code in the runtime.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23421 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-30 15:55:59 +00:00
johnmccutchan@google.com 07ff86eb19 Fix windows build
Review URL: https://codereview.chromium.org//15904013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23352 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 14:45:27 +00:00
johnmccutchan@google.com 9d264aaee5 Add support for loading scripts from http
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23351 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 14:34:15 +00:00
sgjesse@google.com 7841206de5 Change File.directory to not do any IO
Removed the File.directory and File.directorySync methods and added a
File.directory getter. The File.directory getter does not do any IO,
but just calculates the directory of the file from the path.

R=whesse@google.com
BUG=http://dartbug.com/9926

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23349 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 12:38:27 +00:00
whesse@google.com ebbfa6b14b dart:io | Add missing files.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23336 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 09:55:18 +00:00
whesse@google.com 5623cf6b86 A working version of dart_no_snapshot on Android.
BUG=
R=gram@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23335 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 09:43:10 +00:00
lrn@google.com 39c8f31441 Make new StreamController().isPaused be true until the first listener arrives.
This is compatible with what we had before, and makes good sense if you read
"isPaused" as "must buffer incoming events".

R=floitsch@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23318 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 05:39:23 +00:00
zra@google.com 3ae3d6b5b3 When cross-compiling, also build and link run_vm_tests for the host architecture.
E.g. for ARM, run_vm_tests for the host architecture will end up in
out/DebugARM/run_vm_tests.host.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23299 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-28 17:56:07 +00:00
sgjesse@google.com 9d6a64e81b Merge the dart:uri library into dart:core and update the Uri class
This merges the dart:uri library into dart:core removing the dart:uri library. Besides moving the library the Url class has been changed.

* Removed existing Uri constructor as it was equivalent with Uri.parse
* Remamed constructor Uri.fromComponents to Uri
* Moved toplevel function encodeUriComponent to static method Uri.encodeComponent
* Moved toplevel function decodeUriComponent to static method Uri.decodeComponent
* Moved toplevel function encodeUri to static method Uri.encodeFull
* Moved toplevel function decodeUri to static method Uri.decodeFull
* Rename domain to host
* Added static methods Uri.encodeQueryComponent and Uri.decodeQueryComponent
* Added support for path generation and splitting
* Added support for query generation and splitting
* Added some level of normalization

R=floitsch@google.com, lrn@google.com, nweiz@google.com, scheglov@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23266 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-28 13:35:01 +00:00
whesse@google.com a76b78a26e dart:io | Fix a few bugs in the Android port of dart:io.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23260 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-28 12:58:30 +00:00
lrn@google.com 781e84284f Reapply "Active stream subscriptions".
Makes subscriptions the active part of a stream, with the stream
itself being just an inert creator of subscriptions.

This changes the behavior of a "single subscription" stream to match
the documentation: After the subscription is canceled, you can't
resubscribe to the stream. Previously, you could do that, but it was
never documented or intended.
This also makes the stream of a StreamController not be paused while
before it's subscribed - it is always the subscription that is paused
or not, and while there is no subscription, the stream cannot be
paused. Previously the stream was set to paused until the first
subscription in order to prevent events from being lost. That is
handled independently of pauses now.

Adds StreamController.multiplex constructor. This name is tentative,
and likely to change. Its behavior may change as well. It currently
provides a new single-subscription stream each time its "stream"
getter is read, and you can subscribe to these.

Adds StreamIterator class that allows iterating over a stream's data
events using (async) "moveNext()" and "current", like a direct style
Iterator (sorry, it won't work in a for-in loop).

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23237 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-28 07:28:36 +00:00
lrn@google.com cc0d9d57af Revert until Windows crash is debugged.
Reverts r23218, r23217, r23208, r23207, r23206, r23205, r23204.

r23218 | Path observer is listened more than once, so make it multiplex.
r23217 | Add StreamController.multiplex constructor.
r23208 | Fix bug in streamimpl
r23207 | Fix bug in stream iterator.
r23206 | Change expectations for http_parser_test.
r23205 | Fix bug in stream-impl.
r23204 | Make StreamSubscription be the active part of a string.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23221 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-27 13:03:03 +00:00
lrn@google.com ee1c11a2a6 Make StreamSubscription be the active part of a string.
It is the one keeping the buffer of events, not the stream.

R=ajohnsen@google.com, floitsch@google.com, jmesserly@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23204 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-27 08:34:20 +00:00
hausner@google.com c88a53579a Don't use statically declared Mutex in debugger
Hopefully eliminates the "resource busy" errors we occasionally
see on MacOS (issue 10488).

I ran the debugger test 10000 times in a loop on my machine and
never ran into the assert. Let's hope the build bot is happy too.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23178 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 20:35:03 +00:00