Commit Graph

184 Commits

Author SHA1 Message Date
Régis Crelier f91f67a5be [VM] Emit type checks for incoming function arguments in strong mode.
Change-Id: Icd64913f0fc6ba54a0b8517bf05ae4babfae3bdc
Reviewed-on: https://dart-review.googlesource.com/19287
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-11-18 00:31:35 +00:00
Paul Berry ff898fded5 Strong mode fix for socket_patch.dart.
Change-Id: Icf5bcc7ba370ad9880c1565faf3ace046e47abe0
Reviewed-on: https://dart-review.googlesource.com/21262
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-15 20:45:31 +00:00
Paul Berry 7cec90293e [VM,libs] Add workaround for issue 31305.
The tear-off of _NativeSocket.multiplex needs to have runtime type
`(Object) -> void` in order to be passed to the RawReceivePort
constructor.  Once issue #31305 is fixed, we should be able to fix
this by marking _NativeSocket.multiplex's argument as "covariant".
Until then, we have to type the argument as `Object` and then assign
it.

Change-Id: I1c9b7fb77dd3b0a71037459206f8de30ad77f73e
Reviewed-on: https://dart-review.googlesource.com/20822
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-14 21:46:45 +00:00
Dmitry Stefantsov 714dae5ac4 Fix a strong-mode issue in the io-library
Help the compiler to infer types by adding the explicit type argument.

Bug:
Change-Id: I19f0caaf324801d887c6e7a8c782eca667fae069
Reviewed-on: https://dart-review.googlesource.com/18822
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2017-11-07 13:44:19 +00:00
Vyacheslav Egorov 528bc96858 [VM] Cleanup static typing issues in IO implementation
Bug: https://github.com/dart-lang/sdk/issues/31052
Change-Id: I11788f267f99fe5a8d871b8500ca70abe04c7146
Reviewed-on: https://dart-review.googlesource.com/13040
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-10-16 10:05:06 +00:00
Peter von der Ahé e8aef37eac Clean up patches so they can be compiled by Fasta.
Change-Id: Ie436375c78496366accf0ba82938e54cbe30b143
Reviewed-on: https://dart-review.googlesource.com/3001
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-05 14:05:50 +00:00
Peter von der Ahé 327d8d1b0d Fix various warnings found in runtime patches.
Change-Id: I2dd82849df1bfe32c99577f6604e6a4501759697
Reviewed-on: https://dart-review.googlesource.com/7709
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-09-22 13:12:48 +00:00
Florian Loitsch 38bf70d7ac Use generic functions in zones.
Migrated from https://chromiumcodereview.appspot.com/2893893002/

Change-Id: I0bd6dc1438eb1e6762e7760a08b5a760b07d4b10
Reviewed-on: https://dart-review.googlesource.com/4942
Reviewed-by: Florian Loitsch <floitsch@google.com>
Commit-Queue: Florian Loitsch <floitsch@google.com>
2017-09-20 15:46:06 +00:00
Erik Corry 029b1cb948 Spelling fixes e to i.
R=kevmoo@google.com
BUG=

Review-Url: https://codereview.chromium.org/2957593002 .
2017-06-24 13:41:39 +02:00
Zachary Anderson bad6b64062 [Fuchsia] EventHandler: epoll -> ports v2
This CL rewrites the EventHandler on Fuchsia to use
the low-level ports system call API instead of the
epoll() emulation in musl. This will allow the
Magenta team to remove the epoll() emulation and
the deprecated system call API it is based on.

The new ports API doesn't provide epoll()-like
edge-triggering that clients of the EventHandler
expect. Therefore, this CL emulates it by adding
a level of indirection through a new "IOHandle"
object, which the socket code now uses instead
of file descriptors. This is similar to what we do
on Windows. See the comment at the top of
eventhandler_fuchsia.cc for more details.

Fuchsia issue US-251

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2910853002 .
2017-06-23 10:41:21 -07:00
Ben Konyi 86fdbde70a Added timeout parameter to RawSocket and Socket connect, which allows for the specification of a maximum time to wait for a valid connection to be established.
fixes #19120

R=zra@google.com

Review-Url: https://codereview.chromium.org/2946333002 .
2017-06-21 14:31:52 -07:00
Ben Konyi ddc4f30d75 Re-land socket refactor with fixes for Windows.
BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2797993005 .
2017-04-05 12:45:31 -07:00
Ben Konyi 0386f7ab6f Reverting until bots clear up.
Revert "Pulled a significant portion of Socket implementation into BaseSocket in order to prepare for the synchronous socket impementations which will also use these common methods."

This reverts commit 0422920142.

Revert "Updated incorrect call to Write in process_win.cc"

This reverts commit 9e1435148b.

Revert "Fixed incorrect call to Write from process_win.cc"

This reverts commit 11dcab2bed3c9ec8ec76bc200206ac202a4a5681.

Fixed incorrect call to Write from process_win.cc

BUG=

Review-Url: https://codereview.chromium.org/2791163004 .
2017-04-03 17:25:47 -07:00
Ben Konyi 0422920142 Pulled a significant portion of Socket implementation into BaseSocket in order to prepare for the synchronous socket impementations which will also use these common methods.
BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2780063002 .
2017-04-03 17:05:11 -07:00
Jacob Richman 4360e99d18 Revert "Fix observatory tests broken by running dartfmt."
This reverts commit b1f7e6d94673b098c93c187fe3efc45c15f27edc.

BUG=

Committed: https://github.com/dart-lang/sdk/commit/62be0eacfbb36bdc92a05c7c35bb4506621b6a3a
Review-Url: https://codereview.chromium.org/2767533002 .
2017-03-21 10:07:26 -07:00
Jacob Richman 62be0eacfb Revert "Fix observatory tests broken by running dartfmt."
This reverts commit b1f7e6d94673b098c93c187fe3efc45c15f27edc.

BUG=

Review-Url: https://codereview.chromium.org/2767533002 .
2017-03-20 22:19:22 -07:00
Jacob Richman 88f8aacd5f Re-apply rolled back CL to apply dartfmt to runtime.
Fix observatory tests broken by running dartfmt due to line and column changes.
Temporarily reverted formatting for evaluate_activation_test.dart as dartfmt doesn't yet handle multitests.

BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2759973004 .
2017-03-20 21:44:59 -07:00
Ryan Macnak ea4744a06f Revert "Run dartfmt on all files under runtime."
This reverts commit 15f393f189.

The change caused many service test failures due to changed line numbers.

TBR=jacobr@google.com

Review-Url: https://codereview.chromium.org/2762583003 .
2017-03-20 13:42:55 -07:00
Jacob Richman 15f393f189 Run dartfmt on all files under runtime.
I've omitted files where the formatter output is significantly uglier
than the original code and I'll send those files in a separate CL
with options for how to make the code look reasonable while still
taking advantage of the formatter.

BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2751423005 .
2017-03-20 13:13:50 -07:00
Vyacheslav Egorov f746f27870 Fix issues in dart:io implementation found by fasta.
R=kustermann@google.com
BUG=https://github.com/dart-lang/sdk/issues/28882

Review-Url: https://codereview.chromium.org/2718673002 .
2017-02-24 12:19:55 +01:00
Peter von der Ahé 00bed94e0c Fix various nits in VM patch files.
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2705593002 .
2017-02-17 16:28:57 +01:00
Zachary Anderson deb2181067 Don't clobber SocketError's OSError on failed write and send.
related #25342

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2632543002 .
2017-01-12 15:51:45 -08:00
Zachary Anderson 16db33b7a2 Propagate errors correctly in Socket.connect
socket.port can throw an exception. The error from the
exception, if there is one, has to go to the completer,
not be thrown up the stack, otherwise it may go to the
enclosing Zone rather than e.g. a try ... catch around
await Socket.connetc().

This is a possible fix for the issue below, but it is
tough to say because I don't have a reliable repro.

related #27440

R=asiva@google.com

Review URL: https://codereview.chromium.org/2426413006 .
2016-10-19 15:12:59 -07:00
Zachary Anderson a76aa4e70c Throw an ArgumentError if the port is out of range
fixes #27416

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2361373003 .
2016-09-23 11:12:54 -07:00
Matthias Hausner 1a6d1eca32 Implement @patch annotation for patch class members
Allow members of patch classes to be annotated with @patch. The VM
ignores the annotation. I simply replaces the original method
if the name matches, or reports an error if field names match.

Adding a bit is_patched to members to do more checking remains a
TODO. There are currently no unused bits available, and I don’t want
to increase the size of Function objects for this.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2230383003 .
2016-08-10 12:54:57 -07:00
Matthias Hausner e11ca24053 Use metadata annotation @patch for patch classes
Annotate patch classes and top-level patch functions with @patch
instead of the pseudo-keyword patch. This allows the analyzer
to read patch files, and matches the syntax that dart2js uses.

The deprecated syntax is still supported, but a warning is printed when detected.

BUG=

Review URL: https://codereview.chromium.org/2220883004 .
2016-08-09 09:48:03 -07:00
Florian Loitsch 596723f0c3 Fix return type for JoinMulticast.
Fixes #27032.

BUG= http://dartbug.com/27032
R=sgjesse@google.com

Review URL: https://codereview.chromium.org/2220983002 .
2016-08-08 12:22:30 +02:00
Florian Loitsch ef4933df25 Better error-message when bind fails.
See #26790.

R=sgjesse@google.com

Committed: https://github.com/dart-lang/sdk/commit/34aed6a08b8547a985ac701cf3910a5f5450dd52

Reverted: https://github.com/dart-lang/sdk/commit/a1005bad7e249a5510b30683a5ca52b16baafbc4

Committed: https://github.com/dart-lang/sdk/commit/8c4954492f0593f41d270691bb82c26d8509c894

Reverted: https://github.com/dart-lang/sdk/commit/5ebcd3cda0f34be580be1a8ed816849a82691427

Committed: https://github.com/dart-lang/sdk/commit/eaeb260244d524b54d3ec842af2f8400cd543b12

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

Reverted: https://github.com/dart-lang/sdk/commit/90a194be3c03c058c4e087e1bd11823817982393
2016-08-04 14:45:01 +02:00
Florian Loitsch 90a194be3c Enter a description of the change.
Merge branch 'master' into revert

Revert "Better error-message when bind fails."

This reverts commit eaeb260244.

Review URL: https://codereview.chromium.org/2213533002 .
2016-08-03 23:18:39 +02:00
Florian Loitsch eaeb260244 Better error-message when bind fails.
See #26790.

R=sgjesse@google.com

Committed: https://github.com/dart-lang/sdk/commit/34aed6a08b8547a985ac701cf3910a5f5450dd52

Reverted: https://github.com/dart-lang/sdk/commit/a1005bad7e249a5510b30683a5ca52b16baafbc4

Committed: https://github.com/dart-lang/sdk/commit/8c4954492f0593f41d270691bb82c26d8509c894

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

Reverted: https://github.com/dart-lang/sdk/commit/5ebcd3cda0f34be580be1a8ed816849a82691427
2016-08-03 22:44:28 +02:00
Ryan Macnak 5ebcd3cda0 Revert "Better error-message when bind fails."
This reverts commit 8c4954492f.

This change broke the Android build.

Review URL: https://codereview.chromium.org/2201183004 .
2016-08-03 09:54:57 -07:00
Florian Loitsch 8c4954492f Better error-message when bind fails.
See #26790.

R=sgjesse@google.com

Committed: https://github.com/dart-lang/sdk/commit/34aed6a08b8547a985ac701cf3910a5f5450dd52

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

Reverted: https://github.com/dart-lang/sdk/commit/a1005bad7e249a5510b30683a5ca52b16baafbc4
2016-08-03 16:27:48 +02:00
Florian Loitsch a1005bad7e Revert "Better error-message when bind fails."
This reverts commit 34aed6a08b.

Review URL: https://codereview.chromium.org/2210523002 .
2016-08-03 15:47:15 +02:00
Florian Loitsch 34aed6a08b Better error-message when bind fails.
See #26790.

R=sgjesse@google.com

Review URL: https://codereview.chromium.org/2205913003 .
2016-08-03 15:29:41 +02:00
Florian Loitsch e3c3f099ea Fix strong mode errors in dart:io.
Still a lot of strong mode warnings left.

R=fschneider@google.com, sgjesse@google.com

Committed: https://github.com/dart-lang/sdk/commit/5216f1d67d09d289f7c7ceab56a64ce0dcb7d563

Reverted: https://github.com/dart-lang/sdk/commit/7503ecc8fdb32747b2b05b529219ce83da8f0b6c

Review URL: https://codereview.chromium.org/1904553006 .
2016-05-12 13:17:31 +02:00
Florian Loitsch 7503ecc8fd Revert "Fix strong mode errors in dart:io."
This reverts commit 5216f1d67d.

BUG=

Review URL: https://codereview.chromium.org/1966373002 .
2016-05-11 21:44:09 +02:00
Florian Loitsch 5216f1d67d Fix strong mode errors in dart:io.
Still a lot of strong mode warnings left.

R=fschneider@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org/1904553006 .
2016-05-11 14:30:32 +02:00
Zachary Anderson ba550f1c43 Fixes NetworkInterface.list crash on Android
Previously, Socket::ListInterfaces failed to set the os_error out
parameter causing a crash in the caller. This change sets an error here.

I've also added NetworkInterface.listSupported, which returns false on
Android, and true everywhere else. ifaddrs.h continues not to exist in
the NDK, so in order to support NetworkInterface.list, we'd have to
reimplement it, or find a suitable reimplementation somewhere.

related #26329

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1916223003 .
2016-04-26 07:48:58 -07:00
Søren Gjesse 9431f0b32c Fix Mac OS check for terminal input
Closes #25862
BUG= https://github.com/dart-lang/sdk/issues/25862

TBR=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1760033003 .
2016-03-03 10:40:12 +01:00
John McCutchan b9b0649b9c dart:developer service extension fixes
Fixes #25724
Fixes Florian Loitsch's emailed request (get rid of k prefix on constants).

- Rename ServiceExtensionResponse constants to not have a 'k' prefix.
- Provide more explanation on how to invoke service extensions (they require an 'isolateId' parameter).
- Require extension method names to begin with "ext." and recommend the template: "ext.package.command" to avoid conflicts with other packages.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1680593004 .
2016-02-10 08:54:51 -08:00
Søren Gjesse 65872873d2 Remove server socket references
The use of server socket references was deprecated in 1.9 and marked
for removal in 1.10.

R=kustermann@google.com

BUG=http://dartbug.com/22187

Review URL: https://codereview.chromium.org/1072783003 .
2015-10-05 12:25:20 +02:00
Rico Wind c6918fb126 Refactor the io resource classes
Move stopwatch so that we will only ever need one instance

Add utility functions for doing reads and writes

The only functional change here is that I say that an except is a read
of one byte, which also updates the readcount. I think this is just as
correct as what we did before.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1320023008 .
2015-09-09 09:18:07 +02:00
Rico Wind 06ab2bdbdd Extract meta data about open sockets into separate class.
The current implementation only has information about tcp and udp
sockets, and we explicitly do not track internal and pipe uses of
_NativeSockets.

The testing of this is done through the service layer, which is the end user of
this.

BUG=
R=sgjesse@google.com

Committed: https://github.com/dart-lang/sdk/commit/01eff8ce18be7eceb6ce0be1097005965edf2588

Review URL: https://codereview.chromium.org//1323943003 .
2015-09-03 19:18:42 +02:00
Rico Wind 665f397bb8 Revert "Extract meta data about open sockets into separate class."
This reverts commit 01eff8ce18.

Seeing issues on windows and on dart2js

R=sgjesse@google.com
BUG=

Review URL: https://codereview.chromium.org//1323183002 .
2015-09-02 16:18:52 +02:00
Rico Wind 01eff8ce18 Extract meta data about open sockets into separate class.
The current implementation only has information about tcp and udp
sockets, and we explicitly do not track internal and pipe uses of
_NativeSockets.

The testing of this is done through the service layer, which is the end user of
this.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1323943003 .
2015-09-02 15:26:35 +02:00
sgjesse@google.com 48584debbd Make Socket address and port getters available after the socket is closed
There getters are used for generating eddor messages.

TBR=ajohnsen@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44359 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-10 08:54:22 +00:00
sgjesse@google.com 1d808d071b Fixed a number of bugs on RawSocket and Socket
The checking of the closed state was not present when dealing
with the properties port, remotePort, address and remoteAddress
on RawSocket and Socket. Then now all throw SocketException when
the RawSocket or Socket is closed.

* Calling port on a RawSocket would return the port even if it
  was closed

* Calling remotePort, address and remoteAddress did not check for
  OSError

* Calling remotePort, address and remoteAddress on a closed
  RawSocket caused syscalls using the already closed fd, which
  might also have been re-allocated already.

* Calling port, remotePort, address and remoteAddress on a closed
  Socket caused null pointer exception

R=ajohnsen@google.com

Correctly check for errors when getting remote address and port

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44319 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-09 13:33:28 +00:00
whesse@google.com 1d928984a3 Recommit "Fix issues with Socket shutdown.""
This recommits revision r44178, which was reverted in r44180, with changes to
fix the issues with Process.stdin.  It also adds a test for issue 22636, duplicate READ_CLOSED message.

Changes from r44187
Test tests/standalone/io/issue_22636_test.dart added.
Line "native.closedReadEventSent = true;" added to _RawSocket._writePipe() in runtime/bin/socket_patch.dart.

BUG=http://dartbug.com/22636
BUG=http://dartbug.com/22637
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44236 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-04 14:37:34 +00:00
whesse@google.com bbfd19ca02 Revert "Fix issues with Socket shutdown."
This reverts commit r44178, because it makes 10 tests about process stderr
and stdin fail with timeouts.
Original CL: https://codereview.chromium.org/975723002/

BUG=dartbug.com/22637
BUG=dartbug.com/22636
R=kustermann@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44180 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-03 16:51:57 +00:00
whesse@google.com 7d15c8182a Fix issues with Socket shutdown.
BUG=dartbug.com/22637
BUG=dartbug.com/22636

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44178 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-03 16:19:23 +00:00