Commit Graph

3172 Commits

Author SHA1 Message Date
turnidge@google.com 76d4586dea Revert my last change.
Review URL: https://chromiumcodereview.appspot.com//10332257

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7757 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 18:35:04 +00:00
turnidge@google.com 6a8c82db83 Implement spawnUri from dart:isolate. This function allows us to
launch an isolate running a different script.  Finally.

Reviewers: This isn't as hard to review as it looks.  Dive right in!

Siggi: Take a look at my test status file changes and make sure I'm
excluding the right stuff.

Much of the churn in the CL comes from moving ownership of the
import_map.  It used to be set per-library and is now set per-isolate.
This caused a lot of superficial diffs.

DART EMBEDDING API CHANGES:

- Dart_IsolateCreateCallback now takes a script_uri and main argument
  instead of a name_prefix argument.  The script_uri argument allows
  the callback to launch different scripts.  The main argument is used
  in creating the isolate debug name.

- Dart_CreateIsolate now takes script_uri and main arguments.  These
  are used to build the isolate's debug name.

- Dart_LibraryTagHandler, Dart_LoadScript, and Dart_LoadLibrary no
  longer take an import_map.

- Added Dart_SetImportMap.

- Added Dart_RootLibrary to provide access to the root library for the
  current isolate.

OTHER STUFF

Add a couple of tests for spawnUri -- the existing tests assume that
scripts end in a .js suffix which isn't going to work out for us.

Changed how the debug name for isolates get built a bit.

Refactored bin/main.cc a bit.  Fixed some problems with error handling
while creating isolates.

Minor refactoring in builtin.dart to always pass is_windows rather
than relying on it being squirreled away.
Review URL: https://chromiumcodereview.appspot.com//10386107

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7756 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 18:22:10 +00:00
hausner@google.com 6fece3e398 Fix tests in language suite: eliminate String +
The language suite runs clean without String + after this change.

string_concat_test.dart is obsolete, removed.
Review URL: https://chromiumcodereview.appspot.com//10383238

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7745 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 15:33:05 +00:00
ager@google.com 330aa1ab66 Revert "Add more API fuzzing and fix the issues encountered."
I know what is wrong but don't have the time to fix it right now.
I open a lot of files that are not closed and therefore the directory
cannot be deleted on Windows. Will fix ASAP.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7684 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 13:02:48 +00:00
ager@google.com ceb6a9b621 Add more API fuzzing and fix the issues encountered.
- Fixed integer checks in a couple of places.
- Added closed checks to async operations.

More changes like this coming but I'm splitting the work up to not
make the review too large.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7683 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 12:52:10 +00:00
ajohnsen@google.com 657f789b1d Correctly handle the case of a 126 bytes long message, in WebSocket frame encoding.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7678 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 08:43:08 +00:00
ager@google.com c278f6da23 Fix directory listing to actually have the semantics intended.
The directory listing will continue on error (such as broken links)
and the boolean indication when listing is complete will signal
if all operations succeeded.

R=sgjesse@google.com
BUG=dartbug.com/3031
TEST=standalone/io/file_system_links_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7655 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-15 14:33:17 +00:00
ricow@google.com d4ec481b04 Update documentation on Process.close to explain issues with closing before reading out all content of stdout and stderr
Review URL: https://chromiumcodereview.appspot.com//10386140

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7650 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-15 11:48:10 +00:00
sgjesse@google.com 179db55867 Re-apply "Fix URL decoding in HTTP library"
Now URL decoding works for non-ASCII URLs and will be UTF-8 decoded.

Added an additional import to lib/compiler/implementation/lib/io.dart
for the tests to compile with dart2js.

TBR=ager@google.com

BUG=dart:2902
TEST=tests/standalone/io/url_encoding_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7644 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-15 08:57:21 +00:00
sgjesse@google.com 4166edd30b Remove the SHA1 implementation used by web sockets and use the dart:crypto library one instead.
R=ager@google.com

BUG=none
TEST=tests/standalone/io/web_socket_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7640 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-15 07:55:44 +00:00
hausner@google.com de86bd5ed8 Debugger wire protocol: setting breakpoints
- Adding commands to set breakpoints and showing current stack trace.
- Adding a callback hook to signal when a breakpoint gets resolved to
  and actual line number. 
- Adding ids for breakpoints and new breakpoint API functions, deprecating
  the existing ones. 
- Adding one helper function to the JSON class

Anton may want to take a look at the JSON addition.
Review URL: https://chromiumcodereview.appspot.com//10383164

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7628 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-14 21:10:25 +00:00
sgjesse@google.com f861f1c2a0 Add a hash code to client and server web socket connections
The client web socket connection uses part of the nonce generated for
the challenge. The server web socket connection uses the hash code
from the socket.

R=ager@google.com

BUG=dart:3017
TEST=tests/standalone/io/web_socket_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7613 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-14 15:53:28 +00:00
ager@google.com b6e35655cf Make the crypto library an official dart:crypto library.
The library now works on dart2js and on the VM.

Add the library to the API docs and to the sdk.

R=iposva@google.com,dgrove@google.com,kasperl@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7604 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-14 11:20:56 +00:00
sgjesse@google.com 839f6e0587 Revert "Fix URL decoding in HTTP library"
Issues with dart2js tests.

TBR=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7600 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-14 10:26:12 +00:00
sgjesse@google.com 0086312006 Fix URL decoding in HTTP library
Now URL decoding works for non-ASCII URLs and will be UTF-8 decoded.

R=ager@google.com

BUG=dart:2902
TEST=tests/standalone/io/url_encoding_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7599 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-14 09:58:27 +00:00
ahe@google.com e3cad04c02 Split the URI library across multiple files.
Review URL: https://chromiumcodereview.appspot.com//10383103

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7543 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-11 13:40:03 +00:00
ager@google.com 5fb75d3952 Change dart:io to use Future for one-shot operations.
This appears to be what a lot of our users are doing and it is the
style used in our other libraries.

Noteworthy changes:

- File and Directory objects are now immutable.

- Directory.list returns an active lister object.

- Write operations on files return futures and the
  onNoPendingWrites handler is gone. The same
  functionality is there by using 'then' on the
  future returned from the last write operation.

- Process starting is now done with static methods:
  -- Process.start yields an InteractiveProcess.
  -- Process.run yields a Future<ProcessResult>

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7529 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-11 06:09:42 +00:00
hausner@google.com dbd9fa4048 Eliminate need for va_copy in json.cc
The hacked version of va_copy did not work on Linux.
Review URL: https://chromiumcodereview.appspot.com//10383122

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7525 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-10 23:28:14 +00:00
hausner@google.com e5d8d80479 Support more debugger commands in the wire protocol
Also add a very simple debugger shell which at this point
is meant to be a debugging help for the debugger code rather
than a user-friendly tool.
Review URL: https://chromiumcodereview.appspot.com//10392017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7518 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-10 22:04:50 +00:00
asiva@google.com 4f105f9d0b Resubmit change 7506.
Review URL: https://chromiumcodereview.appspot.com//10387061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7511 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-10 19:17:37 +00:00
asiva@google.com 6911f88b25 Revert change 7506 to check on build failure.
Review URL: https://chromiumcodereview.appspot.com//10386073

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7508 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-10 18:36:06 +00:00
asiva@google.com 3e5d8216c3 Fix issue 2888.
Allow for the library tag handler to be setup for the isolate, instead of
while loading a script. This ensures that we can use #import on the boot strap libraries like builtin, uri etc.

This change results in a dart API change and corresponding modifications are
necessary in dartium and App Engine.
Review URL: https://chromiumcodereview.appspot.com//10302020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7506 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-10 18:25:47 +00:00
iposva@google.com 1829b6328a - Fix the no_snapshot build.
Review URL: https://chromiumcodereview.appspot.com//10389072

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7505 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-10 18:16:46 +00:00
ajohnsen@google.com 33dc2dd6e4 Correctly entirely close client connections, when closing http server.
Also remove duplicate call to _connectionEstablished.

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7448 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-09 10:55:42 +00:00
sgjesse@google.com 56945855e9 Add Exception to the class name for recently added exception classes
R=ager@google.com

BUG=none
TEST=none

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7444 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-09 10:18:24 +00:00
sgjesse@google.com fca01e72b7 Avoid using chunked transfer encoding when the HTTP verision is 1.0.
R=ager@google.com

BUG=dart:2938
TEST=tests/standalone/io/http_content_length_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7442 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-09 09:06:28 +00:00
sgjesse@google.com 45c6481a74 Make the HTTP server close non-persistent connections
When closing the connection due to non-presistent connection make sure
that all data are sent to the receiver. For socket close due to errors
or idle timeout destroy the socket.

R=ager@google.com

BUG=dart:2918
TEST=tests/standalone/io/http_connection_close_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7441 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-09 08:53:41 +00:00
sgjesse@google.com a579f1f449 Implemented W3C complient web socket client interface
Fixed a bug where onMessage events could happen before the onOpen event.

R=ager@google.com, ajohnsen@google.com, vsm@google.com, jacobr@google.com

BUG=dart:2001
TEST=tests/standalone/io/web_socket_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7440 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-09 08:47:07 +00:00
sgjesse@google.com 6e1f264b8a Add redirect support to the HTTP client
Redirection is implemented by re-using the same HttpClientConnection
object for several request/response pairs. There is s redirect method
on the HttpClientConnection object for manual redirection. The
HttpClientConnection object also has properties followRedirects and
maxRedirects to configure automatic redirect handling.

When redirection happen the HttpClientConnection will collect the
redirection history for client einspection and for redirect loop
detection.

R=ajohnsen@google.com, ager@google.com

BUG=none
TEST=tests/standalone/io/http_redirect_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7415 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-08 13:32:45 +00:00
sgjesse@google.com 4eea8aac7e Fix wrong type in HTTP library
R=ager@google.com

BUG=none
TEST=none

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7408 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-08 09:52:46 +00:00
sgjesse@google.com 340fc48110 Update HTTP server documentation
R=ajohnsen@google.com

BUG=dart:2934
TEST=none

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7402 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-08 07:04:06 +00:00
ager@google.com 8a677917d5 Address review comments on Options.executable change.
R=iposva@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7401 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-08 06:41:00 +00:00
sgjesse@google.com 728e5e8720 Correct comment wording
TBR=ajohnsen@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7386 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-07 14:53:48 +00:00
ager@google.com 16ee3e9bb3 Add executable to Options interface to get the name of the executable used to execute the script.
This is useful when you want to spawn separate dart processes. We do this from tests and we keep getting bitten by a broken search for the executable. Let's make it available instead.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7382 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-07 14:27:05 +00:00
sgjesse@google.com 315874e470 Add enumeration of the HTTP headers
R=ajohnsen@google.com

BUG=dart:2045
TEST=tests/standalone/io/http_headers_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7377 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-07 13:52:14 +00:00
sgjesse@google.com 370115c39d Better checking and error reporting for HTTP client
R=ager@google.com

BUG=dart:2034
TEST=none

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7371 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-07 11:53:16 +00:00
sgjesse@google.com 3e33c89b62 Fix error reporting for socket write failure
It now includes the OS error in the thrown exception

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7365 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-07 07:44:33 +00:00
cshapiro@google.com 1472427af8 Revert "Revert "Implement {Int,Uint}{8,16,32,64} and Float{32,64} typed arrays.""
This reverts commit 63480a81fccbde001494dd535cd06a8fa02ed261.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7352 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 23:16:09 +00:00
hausner@google.com 901d1a4267 Eliminate busy waiting for debugger connection
Review URL: https://chromiumcodereview.appspot.com//10384016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7348 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 21:24:16 +00:00
hausner@google.com 2cef5e4931 Now it's Linux fix time.
Review URL: https://chromiumcodereview.appspot.com//10380009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7336 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 16:09:56 +00:00
hausner@google.com 03bf4ac75f Stop laughing!
Review URL: https://chromiumcodereview.appspot.com//10383008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7335 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 16:01:55 +00:00
hausner@google.com e21141bdac More windows fixes.
I wish we had a sandbox for test builds before we submit...
Review URL: https://chromiumcodereview.appspot.com//10332015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7334 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 15:56:01 +00:00
hausner@google.com 1b19340a8f And hopefully the last fix...
Review URL: https://chromiumcodereview.appspot.com//10381009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7333 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 15:48:28 +00:00
hausner@google.com 0eb7d38934 More windows fixes.
Review URL: https://chromiumcodereview.appspot.com//10365015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7332 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 15:45:27 +00:00
hausner@google.com d444afd12a Try to fix windows build.
Review URL: https://chromiumcodereview.appspot.com//10332014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7331 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 15:37:11 +00:00
hausner@google.com 95be46105a Beginnings of a debugger wire protocol
The debugger wire handler is implemented similarly to the io event handler.
A dedicated thread monitors the debugger port for incoming connection
requests. When a debugger is connected, the VM sends events messages
over the wire and handles debugger requests.

To start the VM with a debugger connection, use the option
--debug:<portnumber>. The VM pauses at the beginning of main()
and waits for a debugger to connect.

Subsequent changes will implement debugger commands one by one.
With this change, the VM only understands "resume" commands. 
Review URL: https://chromiumcodereview.appspot.com//10357003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7330 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 15:25:49 +00:00
ager@google.com e6b2635059 Change Platform members to getters instead of methods.
R=sgjesse@google.com
BUG=dartbug.com/1668
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7282 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-03 13:16:33 +00:00
sgjesse@google.com 4a4705b0a6 Fix bug in web socket close handling
Don't just close the socket when using the output stream for buffering
data - some data might not be sent.

This was causing the flakiness on Windows.

R=ager@google.com

BUG=dart:2867
TEST=tests/standalone/io/web_socket_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7280 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-03 13:02:59 +00:00
ager@google.com 4cbcc366bb Fix inconsistent file error messages.
R=iposva@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7273 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-03 11:48:19 +00:00
sgjesse@google.com 2904a46214 Implement onClosed on a socket output stream
onClosed on a socket output stream was never implemented.

Use this to correct the close handling of the web socket. Before it
was incorectly relying on no pending writes callback when closing the
connection which does not happen, so closing always happened throught
the timer.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7272 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-03 10:58:06 +00:00