Commit Graph

577 Commits

Author SHA1 Message Date
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
kasperl@google.com 8db48e4171 Revert "Move dart:web to pkg:htmlescape."
This reverts r11943.

R=lrn@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11945 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 13:17:01 +00:00
lrn@google.com bd49eef27d Move dart:web to pkg:htmlescape.
Review URL: https://chromiumcodereview.appspot.com//10905125

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11943 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 12:54:59 +00:00
sgjesse@google.com e6eff314c3 Cleanup and fixes to some dart:io files
Fixed wrong names for constants and some warnings. This includes the changes in https://chromiumcodereview.appspot.com/10913096/.

R=ager@google.com

BUG=dart:4711

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11921 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 07:31:46 +00:00
cshapiro@google.com 26b843c7ee Fix build break on Win32 and MacOS related to printf format string checks.
Implement remaining inttypes.h format specifiers on Win32

Resolve some conversion specifier discrepancies on MacOS.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11913 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 01:14:09 +00:00
cshapiro@google.com da14bf70a7 Add attributions so printf like functions can have their arguments checked.
This change also corrects some misuses of format strings and format
arguments that discovered by the compiler checks.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11912 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 00:58:25 +00:00
asiva@google.com 8aec37055a Rename Builtin::LoadLibrary to Builtin::LoadAndCheckLibrary as the name
LoadLibrary seems to conflict with some windows predefined macros causing
build failures on windows build of dartium.
Review URL: https://chromiumcodereview.appspot.com//10905102

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11894 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-05 18:49:07 +00:00
ager@google.com 2b1e6937b6 Change backlog on http server listen from 5 to 128.
5 simultaneously connecting clients seems like very little. This
also fixes an http client test on Mac. If the backlog is too
small a connection can be dropped again before it is accepted
and the client will get a "broken pipe" or "connection reset"
error.

R=sgjesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11865 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-05 10:40:09 +00:00
ajohnsen@google.com c5890fce1f Cleanup in http_utils.dart.
Followup fixes to ager's DBC.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11863 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-05 09:09:57 +00:00
asiva@google.com 2917199a81 Added option --script-snapshot in gen_snapshot to generate the snapshot of a scipt into the file.
Added option --use-script-snapshot to dart to be able to read a script from a snapshot.

Using this for dart2js produces the following result:

time dart --use-script-snapshot=dart2-js out/ReleaseIA32/dart-sdk/lib/dart2js/lib/compiler/implementation/dart2js.dart tests/language/string_test.dart -oout.js
real    0m1.733s
user    0m1.690s
sys     0m0.030s

without the snapshot the runtimes are:
time out/ReleaseIA32/dart out/ReleaseIA32/dart-sdk/lib/dart2js/lib/compiler/implementation/dart2js.dart tests/language/string_test.dart -oout.js.orig
real    0m2.406s
user    0m2.350s
sys     0m0.040s
Review URL: https://chromiumcodereview.appspot.com//10871092

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11840 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-04 20:46:30 +00:00
ajohnsen@google.com 8fa7d6ab51 Use onClosed instead of onError in the WebSocket classes.
There is a remaining onerror in 'class WebSocket', but as it's
documented (though unused in the spec), we've left it in for
completeness.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11785 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-04 07:26:19 +00:00
ajohnsen@google.com a344ec4713 Use correct cookie date parsing for cookie 'expires' field.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11783 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-04 07:03:29 +00:00
ajohnsen@google.com 0223ae82c8 Don't use TEMP_FAILURE_RETRY on windows.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11771 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-03 14:57:50 +00:00
ajohnsen@google.com 15e0e9e9ee Fix type for container of inet_addr result on Win.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11770 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-03 14:49:06 +00:00
ajohnsen@google.com 0c17bf126c Throw an error if the ServerSocket host argument is invalid.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11769 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-03 14:39:47 +00:00
iposva@google.com 338e6a6806 Fix dartbug.com/3424:
- Remove bogus return type.
Review URL: https://chromiumcodereview.appspot.com//10920049

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11728 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-31 22:07:51 +00:00
asiva@google.com 9ed2e66130 Get rid of support for string interpolation in #import strings.
Review URL: https://chromiumcodereview.appspot.com//10911025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11698 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-31 16:55:03 +00:00
whesse@google.com 14e79b758b Use new getters syntax in dart:io. A few were missed in the first round of cleanup.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11614 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 14:12:47 +00:00
sgjesse@google.com 6a5e76ef77 Better handling of reading empty files
R=whesse@google.com

BUG=dart:4834
TEST=tests/standalone/io/file_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11605 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 11:36:11 +00:00
ager@google.com 178100ded4 Move print to corelib.
Allow embedder customization in the VM through a static field that can
be set by the embedder.

Mark failing test that is unrelated to this change. The VM does not
like when you import dart:core explicitly and tells you there both
'dart:core' and 'dart:core' define 'print'.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11603 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 11:31:30 +00:00
kasperl@google.com 72e668595d Use new try-catch syntax in runtime/, tools/, and utils/.
R=ngeoffray@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11514 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 11:58:58 +00:00
ager@google.com 2ad46b61fe Beginning support for library prefixes in the dart API.
This is a request for comments. Do we want to expose library
prefixes like this? Is there a way to import with a prefix already
and lookup members?

The reason why I would like to do this is so that I can import the
user-supplied builtins library under a prefix. This will be a useful
first step to move the print function to corelib while preserving
the ability to patch in a print implementation via the builtins
library.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11494 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 08:35:43 +00:00
aprelev@gmail.com b15aa52677 Fix lowercasing output filenames for dart:3320 as well as fix for co19 test
BUG=dart:3320
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11488 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 02:55:34 +00:00
iposva@google.com 327ff5d70e - Change "static final" to "static const" in the runtime/ directory.
- Fixed parsing of top-level static const.
Review URL: https://chromiumcodereview.appspot.com//10883071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11425 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 23:51:37 +00:00
hausner@google.com 028f8c78d1 Suppress "Waiting for debugger..." message on cosole
Less noise in the debugger console window.

Also put the verbose debugger output under command line flag
instead of compile time flag.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11328 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-24 17:57:57 +00:00