Commit graph

38 commits

Author SHA1 Message Date
Martin Kustermann 3f0ea0f50e VM: Fix asan memory leak in some standalone tests
Fixes #28350

R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2653583002 .
2017-01-23 19:45:28 +01:00
Zachary Anderson 479a97b129 clang-format runtime/bin
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2480793002 .
2016-11-04 12:30:56 -07:00
Zachary Anderson 103881d01c Make header include guards great again
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER

This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.

R=asiva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/2450713004 .
2016-10-26 00:26:03 -07:00
John McCutchan b6e17330ed Fix DevFS on Android devices
- [x] Allow a system temporary directory to be set on Android.
- [x] This is set on Flutter's engine startup path which fixes DevFS on Android devices.

Related to https://github.com/dart-lang/sdk/issues/4413

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2156243002 .
2016-07-18 10:45:53 -07:00
Zachary Anderson ccfd19bfd7 Fixes memory leak of async directory lister
R=iposva@google.com

Review URL: https://codereview.chromium.org/1893033002 .
2016-04-21 07:57:02 -07:00
Zachary Anderson 45661a7091 Cleanup in //runtime/bin
R=iposva@google.com

Review URL: https://codereview.chromium.org/1800863002 .
2016-03-16 10:01:00 -07:00
Zachary Anderson c75a817ee0 Fixes some memory leaks in //runtime/bin
Also some style cleanups.

Decided to fix these leaks by using Dart_ScopeAllocate
instead of malloc and new. Leaks are noted in the CL.

I haven't finished looking over all the code in
//runtime/bin yet, but this CL was getting big.

Review URL: https://codereview.chromium.org/1781883002 .
2016-03-14 11:08:52 -07:00
iposva@google.com 14ecdbd66a - Separate the thread implementation used in bin/ and vm/
to allow us to make VM specific changes.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39172 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 23:19:53 +00:00
ajohnsen@google.com c3a9f33ef8 Fix directory-listing to return a future on cancel.
This also fixes an issue where we would leake FDs/HANDLEs if the listing was interrupted.

Add new pause-resume-cancel test of directory listing.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29454 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-29 15:04:59 +00:00
whesse@google.com 3c0c99a3b9 Add Directory.systemTemp getter to replace createSystemTemp().
BUG=dartbug.com/12496
R=rnystrom@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28215 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-03 12:55:30 +00:00
whesse@google.com b221c702a3 dart:io | Add Directory.CreateSystemTemp(template) and change Directory.CreateTemp(template).
BUG=dartbug.com/12496
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28097 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 15:38:01 +00:00
whesse@google.com 5b95688b5f dart:io | Remove unused asynchronous file request enums.
BUG=
R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28056 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-30 15:23:38 +00:00
ajohnsen@google.com a347038cd7 Merge services into a shared IOService in dart:io, and use a native port.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27883 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-25 15:03:24 +00:00
asiva@google.com 45445820da Replace uses of Dart_GetClass with Dart_GetType and Dart_InstanceGetClass with Dart_InstanceGetType (The idea is to deprecate Dart_GetClass and Dart_InstanceGetClass from the API)
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24244 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 18:11:47 +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
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
sgjesse@google.com 2ef54d314a Add the ability to change the working directory
Directory.current have been changed from a factory constructor to a
getter and setter. The getter returns a Direcotry object holding the
current working directory. The setter changes the current working
directory of the Dart process.

R=whesse@google.com

BUG=https://code.google.com/p/dart/issues/detail?id=6316, https://code.google.com/p/dart/issues/detail?id=8893

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22116 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-29 12:43:53 +00:00
smok@google.com ebbc2020a2 Put everything in runtime/bin into ':🎯:bin' namespace.
Review URL: https://codereview.chromium.org//14341015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22032 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-25 14:22:30 +00:00
whesse@google.com d2ea504b60 dart:io | Add "followLinks" optional parameter to Directory.list, let it return Link objects when false.
BUG=dartbug.com/7720

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20370 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-22 09:56:14 +00:00
sgjesse@google.com 488b016a2f Merge IO v2 branch to bleeding edge
R=ager@google.com, ajohnsen@google.com, whesse@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18820 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 11:58:11 +00:00
whesse@google.com 7f60b90a48 Add synchronous directory listing to dart:io Directory.
BUG=dart:4730

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16636 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-04 13:51:15 +00:00
ager@google.com 0d58bde8be Add support for directory renaming to dart:io.
R=sgjesse@google.com
BUG=dartbug:3104
TEST=standalone/io/directory*

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7848 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-22 12:46:25 +00:00
sgjesse@google.com 471f1c772c Add error handling to directory
The directory object now has error handling like the rest of the
dart:io. The added tests to some extend overlaps with some of the
tests in DirectpryTest.dart, but I found it better to have error tests
in a single place.

I removed a few type checks sitting in the C++ code for the native
functions as for file we currently don't have them. I have opened
issue 2305 regarding where to do type checks for dart:io native
functions.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5866 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-27 08:50:35 +00:00
sgjesse@google.com 84836f8c56 Error reporting on File in dart:io
This implements consistent error reporting on all methods on File in dart:io. The async onError method is called with an exception argument which is the same exception as would have been thrown from the corresponding sync method.

The one method on Directory which already did this has been updated as well.

R=ager@google.com

BUG=none
TEST=tests/standalone/src/io/FileTest.dart, tests/standalone/src/io/FileInvalidArgumentsTest.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5396 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 13:00:47 +00:00
sgjesse@google.com f0f34bf277 Add the ability to get the current directory
Added constructor current to directory. Use like this:

var cwd = Directory.current()

R=ager@google.com

BUG=dart:1793
TEST=tests/standalone/src/io/DirectoryTest.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5087 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-07 13:23:08 +00:00
sgjesse@google.com b52a27889d Use a pool of native ports for directory operations
Each directory object creates a new service port which will start a
new thread. As these service ports are currently never closed this is
a huge problem causing the standalone VM to fail when running out of
threads.

This change uses a pool of native ports for directory operations. This
still ensures that the operations for each directory object are
serialized and limits the number of native ports allocated and thus
threads started.

Even when closing of native ports is possible we might want to keep
some kind of pool like this. The reason for this is that to actually
determine when the native port is not needed any more we need a
finalizer callback on the directory object.

R=ager@google.com

BUG=none
TEST=tests/standalone/src/ManyDirectoryOperationsTest.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4795 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 14:29:12 +00:00
sgjesse@google.com 9390f1577a Run all directory async operations on a separate thread using native ports
R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4390 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-21 11:35:42 +00:00
ager@google.com 641cf84f6a Implement recursive directory deletion.
Additionally, make sure that the handler can be registered after
the operation in file and directory implementation:

  dir.delete();
  dir.deleteHandler = () => print('hest');

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3892 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-03 12:37:30 +00:00
ager@google.com 607eea1402 Cleanup gypi mess.
My change that introduced a platform directory shared between vm and bin runtime components did not correctly update gypi files.

BUG=
TEST=

Review URL: http://codereview.chromium.org//9124030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3155 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-10 16:50:14 +00:00
ager@google.com c4c92c4f7b Introduce runtime/platform directory for code shared between vm
and bin.

Cleaned up globals.h. Common parts now in platform/globals.h.
vm specific parts are in vm/globals.h and bin/globals.h is gone.

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

Review URL: http://codereview.chromium.org//9114008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3030 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-06 11:28:21 +00:00
sgjesse@google.com 9f92d783ef Change temp dir generation on Windows to use UUIDs instead of random numbers
This avoids having to generate random numbers for all platforms as
only Windows was using them. Also when the andom number generator is
deterministic the Windows implementation using random numbers could
end up running out of temporary files.

R=whesse@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//8879058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2417 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-14 07:25:09 +00:00
sgjesse@google.com f2bda92a66 Add support for getting OS error information for creating temporary directories
R=whesse@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//8934004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2385 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-13 14:22:50 +00:00
whesse@google.com f40da67d2b Add Directory.createTemp() to asynchronously create a temporary directory.
BUG=
TEST=

Review URL: http://codereview.chromium.org//8588029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1741 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-22 13:06:39 +00:00
ager@google.com 953d2599c1 Add exists, create and delete to directory implementation on Linux and Mac.
All of the directory implementations on Linux and Mac are identical
and uncontroversial. Join the implementations in directory_posix for
now. I will split it into the two files again if it becomes necessary.

BUG=
TEST=

Review URL: http://codereview.chromium.org//8277033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@432 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-14 12:42:44 +00:00
ager@google.com 59135cc57b Clean up directory listing interface.
Remove open and close. A directory instance just holds a string
representing the path to the directory.

R=sgjesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8244001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@362 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-12 10:39:30 +00:00
ager@google.com 023fa46e48 Finish non-recursive synchronous directory listing on Linux and Mac.
Next steps: Testing, Windows support and using isolates to make
listing async.

We should probably change the API to not tie a Directory object
to a given OS directory structure. When spawning an isolate to
perform a listing operation, that will open the directory,
list its contents and close the directory. That way we can
do multiple listing operations with the same Directory object
without having interference.

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

Review URL: https://chromereviews.googleplex.com/3511020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 14:33:49 +00:00
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00