Commit Graph

3172 Commits

Author SHA1 Message Date
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
blois@google.com c9f164aed4 Improving path.relativeTo to add support for a broader set of absolute paths.
I had made a last minute change in my previous CL (changing from a string operation to using hasTrailingSeparator), but forgot to test it.

First change is the original, second has the fix.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13435 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-09 19:58:10 +00:00
blois@google.com 5ec7bcc034 Revert "Improving relative path support."
This reverts commit 13422 which broke VM win & mac.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13423 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-09 17:02:51 +00:00
blois@google.com 95aabfc319 Improving relative path support.
I'm looking to modify our HTML tests to use relative paths and it was mentioned that I should be using Path.relativeTo- this change fixes relativeTo to handle the cases that I need.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13422 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-09 16:48:48 +00:00
sgjesse@google.com 66b7a2c9c9 Addressed drive by comments
DBC from ager@ on http://codereview.chromium.org/11066041/.

R=ager@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13415 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-09 14:07:42 +00:00
sgjesse@google.com 0a95ca17a6 Fix another issue with r13348
Add missing const.

TBR=ajohnsen@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13351 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-08 12:58:56 +00:00
sgjesse@google.com 2eb693a104 Fix error in in r13348
The name of a constructor cannot be the same as the name of a member
declared in the immediately enclosing class.

TBR=ajohnsen@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13350 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-08 12:46:13 +00:00
sgjesse@google.com aa7652cccf Add support for HTTP proxy in the HTTP client
An HttpClient instance now has the property findProxy. This
property can be set to a function which can return the proxy
configuration encoded in a string in the same format as is used
by browser PAC (proxy auto-config) scripts.

Currently only the first proxy in the list will be used. I will
address trying multiple proxies in a separate CL.

Also fixed a HTTP input stream bug revealed by the tests. If an
input stream from either a HttpRequest or HttpClientResponse
object is retreived after all data in the body has been received
the HTTP input stream would call the onClosed callback.

R=ajohnsen@google.com

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13348 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-08 12:19:14 +00:00
asiva@google.com ceed3e5beb - Add support to interrupt a running isolate with the following command:
<===  InterruptCmd = "{" RequestId "," command ":" interrupt "," params ":" "{" isolateId ":" Integer "}" "}"
===>  InterruptCmdResp = "{" RequestId "}"

- Send isolate events over to the debugger client in the following format:
===>  "{" event ":" isolate "," params ":" "{" reason ":" created "," id ":" Integer "}" "}"
===>  "{" event ":" isolate "," params ":" "{" reason ":" shutdown "," id ":" Integer "}" "}"
===>  "{" event ":" paused "," params ":" "{" reason ":" interrupted "," callFrames ":" StackTrace "}" "}"

- Added id ";" Integer, to params in all paused events messages

- create per isolate debugger message queues, instead of the global static one

- Add 'i' command in ddbg to exercise the interrupt feature

- Add support for handling isolave event messages in ddbg
Review URL: https://codereview.chromium.org//11028040

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13333 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-05 23:10:28 +00:00
sgjesse@google.com 34d3834394 Refactor HttpClient internals to use Uri class for passing connection information
This is in preparation for adding proxy server support.

R=ajohnsen@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13232 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-04 14:11:38 +00:00
asiva@google.com 6076250adb 1. Create a port when a debugger object is created for an isolate, use this
port as the unique ID to represent an isolate in the debugger message
   format.

2. Switch the Event handler API to use an isolate id instead of the isolate
   object itself.

3. Add a unit test case for isolate debugger event handling with an
   interrupt of isolate to ensure that interrupting the isolate runs
   the interrupt event handler.
Review URL: https://codereview.chromium.org//11052006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13207 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-04 00:13:37 +00:00
asiva@google.com 862687a987 First step towards support for being able to interrupt a running Dart Isolate
using the debugger API
- restructure the debug connection handler code to allow a native thread
  to accept debug connections and read debug commands
- added a new message queue data structure for being able to dispatch
  debug commands on a per isolate basis
- add framework for generic commands and isolate specific commands.
Review URL: https://codereview.chromium.org//10990089

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13186 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-03 17:13:43 +00:00
asiva@google.com 27e1b05914 Add isolate event handler setup in order to be able to propagate isolate
events (create/shutdown/interrupted)
Review URL: https://codereview.chromium.org//11026011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13130 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-02 18:09:55 +00:00
ager@google.com 0f53862f55 Change run_vm_tests to take the VM arguments before the test name so
it acts more like the standalone VM. That way the test scripts can
uniformly pass extra arguments to the cctest runner and to the VM
itself.

The use case for this is that it is nice to be able to add extra
vm flags to all tests using the --special-commands flag for the
test runner:

./tools/test.py --special-commands='time @ --vm-flag'

This will turn cc tests into:

time run_vm_tests --vm-flag Selector

and VM tests into:

time dart --vm-flag my_test.dart

R=ricow@google.com,asiva@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13067 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-01 14:04:26 +00:00
ager@google.com f97265d731 Clean up file implementation.
The _FileUtils class is not needed it is used to hold methods used
from multiple places. After we started using native ports for the
async API most of these are used from only one place.

BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13054 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-01 09:21:18 +00:00
ager@google.com 2cdc686c00 Fix errors caused by missing argument checking
R=sgjesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13006 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 11:42:14 +00:00
ahe@google.com 273a50248f Minor improvement to File diagnostics
Review URL: https://codereview.chromium.org//10983066

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13005 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 11:41:08 +00:00
ager@google.com abee5139e5 Reapply change to hide VM-only List implementation classes.
The performance issue was that I had not updated the method
recognizer.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13003 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 11:08:38 +00:00
ager@google.com fe66a0af1a Revert hiding of VM-only coreimpl list implementation types. While I
investigate performance regression (even after fixing constructors
in the intrinsifier).

R=iposva@google.com,srdjan@google.com,fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12963 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-27 14:07:56 +00:00
lrn@google.com 37197c2553 Stop using the Hashable interface.
All objects have a hashCode method, so there is no need for a Hashable
interface.
The interface itself is retained for at least two weeks, to give time for
code to remove uses of it.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12955 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-27 13:07:54 +00:00
ager@google.com 8e6a2c8345 Hide VM-only coreimpl List implementation types. These should not be
exposed as visible parts of coreimpl.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12952 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-27 12:37:30 +00:00
fschneider@google.com 71767f5218 Add code for CPU feature detection and use it to detect SSE3 and SSE 4.1.
The Dart VM now requires at least SSE3 to build and run.

There is a new flag --use-sse41 (default:true) to disable the use of 
SSE 4.1 features manually. 
Review URL: https://codereview.chromium.org//10990028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12897 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-26 09:08:21 +00:00
ager@google.com 7977b42215 Update all occurrences of raw strings.
R=hausner@google.com,kasperl@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12893 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-26 06:01:23 +00:00
lrn@google.com a1faa6f135 Change IllegalArgumentException to ArgumentError.
Review URL: https://codereview.chromium.org//10989013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12841 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 12:27:52 +00:00
iposva@google.com d3f5b60cd5 - Add support for --help and --verbose to print usage message of the standalone binary.
Review URL: https://codereview.chromium.org//10979006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12814 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 22:26:37 +00:00
ager@google.com 5c9f9ef74f Avoid needless int64_t to intptr_t conversion in eventhandler.
R=sgjesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12693 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 11:40:40 +00:00
ager@google.com 6236cd51a5 Use native fields for process pid and fix bug that allowed killing
a process before it was started.

We should make the change to make Process.start return a future that
does not complete unless the process is actually started. That would
have avoided this issue as well.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12691 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 11:07:36 +00:00
sgjesse@google.com 4ecf9c3a19 Update documentation for HTTP response status code
R=ager@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12685 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 09:06:50 +00:00
ager@google.com c6aea6b1eb Use native wrapper fields to store socket ids.
This relies on landing the change to fix implicit super constructors
for subclasses of something that has native fields.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12684 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 08:19:01 +00:00
ager@google.com e676e88f81 Introduce a VM-only dart:scalarlist library for byte arrays.
Include it in the SDK so users can use it. Create a dummy
implementation and patch file for the library for dart2js so it can be
documented. Johnni, can you think of a nicer way of making
documentation generation work for a VM only library? Also, it seems that
patching kills the documentation comments and they do not show up in
the generated docs.

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

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

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