Commit Graph

3601 Commits

Author SHA1 Message Date
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
jackpal@google.com c6920baa3b Improve dlsym() error-detection.
Avoid false-positive error detection by calling dlerror() once (and
ignoring the result) before calling dlsym().

See "man dlsym" on a Linux machine for more discussion of how to detect
errors when calling dlsym().

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12504 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 16:44:41 +00:00
ager@google.com 1159462fc6 Switch from interfaces to abstract classes in dart:io.
Add a bunch of default argument values to the abstract classes
so they are picked up by dartdoc.

R=sgjesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12484 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 10:54:37 +00:00
sgjesse@google.com b0790fa96d Never send reserved status codes in a close frame
When receiving a close frame with no status code the reported status
code is 1005. If the close is echoed as part of the close handshake
the echoed close frame must also have no status code and NOT status
code 1005.

The description of status code 1005 from the spec:

1005 is a reserved value and MUST NOT be set as a status code in a
Close control frame by an endpoint.  It is designated for use in
applications expecting a status code to indicate that no status
code was actually present.

R=ajohnsen@google.com

BUG=dart:5209

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12482 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 10:27:47 +00:00
sgjesse@google.com ff654354be Make it possible to read a specific number of characters from a string input stream
R=ager@google.com

BUG=dart:4954
TEST=tests/standalone/io/string_stream_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12474 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 08:25:26 +00:00
jackpal@google.com 5ef2b814bd Don't use TEMP_FAILURE_RETRY macro with inet_addr
inet_addr is not a syscall, therefore it should not be used with the
TEMP_FAILURE_RETRY macro.

This fixes a warning in the Android build.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12447 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-17 18:48:33 +00:00
jackpal@google.com e71572cebc Use casts to work around bug in Android TEMP_FAILURE_RETRY macro
See http://code.google.com/p/android/issues/detail?id=37426
"unistd.h TEMP_FAILURE_RETRY generates warning when used with syscall
 that returns unsigned int".

The Android version of this macro will generate a signed/unsigned
comparison when used with a syscall function that returns an unsigned
value such as inet_addr(), which returns in_addr_t, which is defined as
an unsigned int. By casting the result to an int before the macro
processes it, and then casting it back to an in_addr_t after the macro
returns it we are able to avoid the signed/unsigned comparison, and so
avoid the signed/unsigned comparison warning.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12395 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-14 18:20:24 +00:00
scheglov@google.com b388161d1f Issue 3476. Final variables don't have to have constant initializers
http://code.google.com/p/dart/issues/detail?id=3476

R=jwren@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12382 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-14 13:04:19 +00:00
ager@google.com 5a1505200b Use const instead of final for constants.
R=sgjesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12371 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-14 09:53:24 +00:00
ager@google.com 665aaf939f Patch print directly in corelib instead of going through coreimpl.
R=ajohnsen@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10928145

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12316 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 11:50:19 +00:00
sgjesse@google.com 2e90f3bed7 Add web socket error codes constants
Also update the onClosed comment.

R=ajohnsen@google.com

BUG=dart:5125

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12307 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 08:48:19 +00:00
devoncarew@google.com fdae229dcc Fix for http://code.google.com/p/dart/issues/detail?id=5085 - break-on-exceptions in the debugger can recurse.
This CL turns off the break-on-exceptions behavior when evaluating Dart code in the debugger (in particular, the toString() method).
Review URL: https://chromiumcodereview.appspot.com//10928149

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12275 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 18:01:50 +00:00
ager@google.com 612b2716f9 Fix http input stream double close problem.
Make sure to record the fact that we are calling close in
_closeReceived so the client close handler cannot trigger another
close.

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

Review URL: https://chromiumcodereview.appspot.com//10914224

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12256 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 11:21:45 +00:00
ager@google.com 7144395982 Move VM specific library files to the runtime/lib directory so they do
not become part of the SDK.

We should get rid of these files and use the real library file that
sources the rest of the implementation. That work is tracked in
dartbug.com/5099.

R=iposva@google.com
BUG=dartbug.com/5069

Review URL: https://chromiumcodereview.appspot.com//10913214

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12240 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 07:35:34 +00:00
ager@google.com 0163d32763 Fix closing of server sockets.
Waiting for the onClosed event on the socket output stream is the
right thing to do. However, only if we actually make sure that it
will always close. :-)

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

Review URL: https://chromiumcodereview.appspot.com//10914200

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12199 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-11 14:44:41 +00:00
ajohnsen@google.com 71c2201cc7 Fix two issues in the websocket.
- Correctly report protocol error as error 1002.
- If the socket is teared down while writing, correctly report the
error.

BUG=

Review URL: https://chromiumcodereview.appspot.com//10905214

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12198 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-11 14:43:12 +00:00
ager@google.com d2d65ee3b5 Fix for Directory.exists on Windows using GetFileAttributes
based on patch from Alexander Aprelev.

Discriminate different reasons for not being able to get
the file attributes. Currently this makes no difference since
both DOES_NOT_EXIST and UNKNOWN turn into a false return value
from Directory.existsSync().

R=sgjesse@google.com
BUG=3914

Review URL: https://chromiumcodereview.appspot.com//10916206

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12106 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-10 10:38:46 +00:00
asiva@google.com 6a0ea0d428 Simplify functions in Builtin class and get rid of unused code.
Review URL: https://chromiumcodereview.appspot.com//10911135

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12085 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-08 01:00:28 +00:00
lrn@google.com 978c3f6da6 Move dart:web to pkg:htmlescape.
Remove the dart:web library from the VM.
Remove reference to web library from libraries.dart.

Review URL: https://chromiumcodereview.appspot.com//10919147

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12023 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 12:30:55 +00:00
ager@google.com 8f897af27a Fix an analyser error in the http_impl. The code works fine on the VM.
R=sgjesse@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10918118

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12020 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 12:19:13 +00:00
hausner@google.com e0ed54ea8e Add named constructor name checking
Named constructors may not clash with any other class members.
Add a check but enable it only when --construcotr_name_check
runtime flag is passed to the VM.

Eliminate one named constructor in Process class in core library,
as well as a couple of cases in dart2js.

The dart2js team may want to rename the constructors I changed.

Issue 3990  (http://code.google.com/p/dart/issues/detail?id=3990)
 
Review URL: https://chromiumcodereview.appspot.com//10905109

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11972 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 18:02:41 +00:00
ager@google.com d5d5c75bf7 Do not close sockets for http connection fully before we are
done writing data to them.

This fixes the remaining skipped/failing http tests on Windows.

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

Review URL: https://chromiumcodereview.appspot.com//10908121

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11951 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 14:08:43 +00:00