Carlo Bernaschina
05367c3db8
Update iOS FileSystemWatcher::WatchPath signature
...
TBR=zra@google.com
Review-Url: https://codereview.chromium.org/3011703002 .
2017-08-31 09:46:28 -07:00
Zachary Anderson
d0295c873c
[dart:io] Namespaces for file IO
...
Fuchsia requires the ability to sandbox Isolates w.r.t. file IO.
When a new Isolate starts, Fuchsia will pass the Isolate an object
called a namespace. We can translate the namespace object into a
file descriptor suitable for passing to the *at() family of
POSIX file system calls. The file system calls will then
have visibility only into the specified namespace.
We also plumb Namespaces through on all the other platforms as well to
make the change easier to test and so that in the future we can
implement e.g. per-isolate cwds.
This change adds a new internal class to dart:io called _Namespace,
which is implemented in a patch file. See:
sdk/lib/io/namespace_impl.dart
runtime/bin/namespace_patch.dart
The embedder can set up a non-default namespace by calling
_Namespace._setupNamespace during Isolate setup.
Instances of _Namespace have a native field that holds a pointer
to a native Namespace object. See:
runtime/bin/namespace.h
Calls from e.g. file_impl.dart are now also passed a
_Namespace object. The implementations in e.g. file.cc and
file_linux.cc then extract the namespace, and use it to compute a
file descriptor and path suitable for passing to e.g. openat().
related US-313
R=asiva@google.com , rmacnak@google.com
Review-Url: https://codereview.chromium.org/3007703002 .
2017-08-30 09:34:36 -07:00
Zachary Anderson
747868f2b1
[dart:io] Remove DART_IO_DISABLED
...
This was only used by Dartium.
Review-Url: https://codereview.chromium.org/3009523002 .
2017-08-24 11:17:52 -07:00
Zachary Anderson
6cd8a79078
VM: Re-format to use at most one newline between functions
...
R=asiva@google.com
Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Ryan Macnak
877284947b
Rename TARGET_OS_* to HOST_OS_*.
...
Like HOST_ARCH_*, HOST_OS_* describes the OS the VM is running on, which may be different from the OS the VM is generating code for during AOT compilation.
Currently we conflate the two when emitting AOT as assembly, and we get away with it because Flutter only uses assembly for targeting iOS and one can only target iOS from a Mac, but we expect to use assembly for Android as well so native tools can unwind Dart frames.
R=zra@google.com
Review-Url: https://codereview.chromium.org/2750843003 .
2017-03-15 13:11:05 -07: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
7308e58c3f
Really remove io support when dart:io is unsupported.
...
Previously we would compile in implementaitions of native calls for
IO functions that would never be used. This CL provides implementations
that throw a Dart exception if they're called by mistake. It also uses
a DART_IO_DISABLED preprocessor define to clean up the build files and
check that we're not including code we shouldn't.
R=iposva@google.com , johnmccutchan@google.com
Review URL: https://codereview.chromium.org/1839463002 .
2016-03-29 11:22:03 -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
William Hesse
e6b85bb28c
Use #if TARGET_OS_IOS instead of #ifdef TARGET_OS_IOS.
...
New versions of the OS X SDK always define TARGET_OS_IOS, as 0 or 1.
BUG=https://github.com/dart-lang/sdk/issues/24501
BUG=https://github.com/dart-lang/sdk/issues/24453
R=iposva@google.com
Review URL: https://codereview.chromium.org/1388973002 .
2015-10-12 12:38:10 +02:00
Ivan Posva
7158d5fc26
Landing https://codereview.chromium.org/1171223003/ for Chinmay.
...
BUG=
Review URL: https://codereview.chromium.org//1174343006 .
2015-06-13 06:36:24 -07:00
sgjesse@google.com
91e7a32eb5
Remove SetNonBlocking/SetBlocking methods from Socket and add missing close-on-exec
...
The methods SetNonBlocking/SetBlocking on Sockets where not implemented on Linux
and not used on Windwsm. Removed and call directly to FDUtils when needed.
In Socket::Accept setting close on exec was missing on OS X and Android.
R=kustermann@google.com
BUG=
Review URL: https://codereview.chromium.org//907883002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43627 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 07:29:36 +00:00
ajohnsen@google.com
cdaf11dc9d
Don't use kFSEventStreamCreateFlagNoDefer as it messes with event flushing.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//321133002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37171 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-10 10:44:20 +00:00
ajohnsen@google.com
0c157cd31e
Move signal_blocker to platform and use it by default in TEMP_FAILURE_RETRY.
...
BUG=http://code.google.com/p/dart/issues/detail?id=16927
R=johnmccutchan@google.com , sgjesse@google.com
Review URL: https://codereview.chromium.org//165723007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33745 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-17 13:51:11 +00:00
ajohnsen@google.com
76368bfa29
Really really fix the build...
...
BUG=
Review URL: https://codereview.chromium.org//144283010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32598 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-12 09:28:55 +00:00
ajohnsen@google.com
9afc9cac70
Fix mac os x build.t
...
BUG=
Review URL: https://codereview.chromium.org//159723010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32597 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-12 09:16:30 +00:00
ajohnsen@google.com
d00f632847
Use Thread::Compare instead of ==.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//157813011
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32596 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-12 08:47:01 +00:00
ajohnsen@google.com
9c08471e3a
Remove DEBUG ifdefs.
...
BUG=
Review URL: https://codereview.chromium.org//152883003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32423 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 13:18:05 +00:00
ajohnsen@google.com
d074156ac9
Move all run-loop calls into the run-loop thread, and use correct memory handling (retain/release).
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//140183004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32421 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 12:49:33 +00:00
ajohnsen@google.com
b88a51bd99
Fix file-watcher on mac by always starting/stopping through the run-loop thread.
...
This also fixes some system error-printing and maybe also early events.
BUG=https://code.google.com/p/dart/issues/detail?id=16216
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//147083015
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32355 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-06 13:16:13 +00:00
ajohnsen@google.com
969eaf8068
Fix watch move event when path is a not a file.
...
BUG=https://code.google.com/p/dart/issues/detail?id=15458
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//110533008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31328 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-20 11:28:53 +00:00
ajohnsen@google.com
abdc2ade9d
Rewrite file-system-watcher to better handle the different system APIs.
...
BUG=http://code.google.com/p/dart/issues/detail?id=14941
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//98773002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30848 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-04 10:35:00 +00:00
ajohnsen@google.com
79cf8dc61f
Don't report file-system move events on Mac OS, and use no-defer to avoid past events.
...
Mac OS does not have a proper way to report 'from' and 'to', thus making it impossible to reason the move direction, as other events may shuffle the order, events are received in.
BUG=https://code.google.com/p/dart/issues/detail?id=14806,https://code.google.com/p/dart/issues/detail?id=14793,https://code.google.com/p/dart/issues/detail?id=14849
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//88063002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30710 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-27 11:48:14 +00:00
ajohnsen@google.com
7f9dfb1890
Fix move-watched-dir for MacOS.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//46183007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29536 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 12:24:10 +00:00
ajohnsen@google.com
2101ba9c12
Add 'isDir' to FileSystemEvent.
...
BUG=https://code.google.com/p/dart/issues/detail?id=14425
R=whesse@google.com
Review URL: https://codereview.chromium.org//48613002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29371 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-28 17:14:43 +00:00
ajohnsen@google.com
483228ef66
If a move has matching target/destination, signal the event as create or delete.
...
BUG=https://code.google.com/p/dart/issues/detail?id=14424
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//48513003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29354 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-28 12:07:46 +00:00
ajohnsen@google.com
4894d4548c
Fix issue where we would double unwatch the path.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//39773002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29164 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-24 10:26:00 +00:00
ajohnsen@google.com
33daee971b
Use while(condition) around monitor wait, in file_system_watcher_macos.
...
This fixes a potential threading-issue, where the wacther could be used before it was fully initialized, if 'wait' woke up before notify.
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//39713002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29163 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-24 10:24:08 +00:00
ajohnsen@google.com
b4be8b8080
Stop watching when removing watched path, for Mac OS X as well.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//39683002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29161 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-24 08:42:07 +00:00
ajohnsen@google.com
b8d9214b2c
Be sure to enter monitor before notifying, in file_system_watcher_macos.
...
BUG=https://code.google.com/p/dart/issues/detail?id=13065
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//23967004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27178 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-05 08:14:48 +00:00
ajohnsen@google.com
7c53dfaf3f
Make file system watcher compile on Mac OS 106, and add a runtime-call to test if the system supports the feature.
...
BUG=
R=kustermann@google.com , sgjesse@google.com
Review URL: https://codereview.chromium.org//23483030
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27064 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 15:42:02 +00:00
ajohnsen@google.com
38bae0af02
Add FileSystemWatcher class to dart:io.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//19263003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27048 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 12:43:08 +00:00