Lasse R.H. Nielsen
a15025fc85
Harden StreamIterator against out-of-order events.
...
Users have seen event being sent *during* the `listen` call
to the underlying stream. This caught the `StreamIterator`
in an unanticipated state (subscription wasn't available yet).
Sending events during a `listen` call can currently happen
using a synchronous broadcast stream controller adding
events in the `onListen` callback.
That should be fixed so that broadcast stream subscriptions
are treated as paused during the `onListen` call like
single-subscription streams already are.
This change hardens the class against that particular malpratice,
but it's still possible to get into inconsistent states if the
`listen` call somehow manages to call back into the same
stream-iterator again. So, don't do that.
(The class also assumes that no stream will send events/call callbacks
* while paused.
* after cancelling
* after a done event
* while delivering another event.
If a stream does so, things will still crash.
It is believed that no platform stream will do any of these.)
Fixes #43779 .
BUG= http://dartbug.com/43779
Change-Id: If47065cfa9a1115425fdf51b147f2ed7154fef99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167800
Reviewed-by: Nate Bosch <nbosch@google.com >
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com >
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com >
2020-10-16 20:20:02 +00:00
..
2018-02-02 15:50:16 +00:00
2017-09-20 15:46:06 +00:00
2018-06-29 02:06:51 +00:00
2017-10-20 16:41:18 +00:00
2017-10-20 16:41:18 +00:00
2017-10-20 16:41:18 +00:00
2017-10-20 16:41:18 +00:00
2017-10-20 16:41:18 +00:00
2017-10-20 16:41:18 +00:00
2017-10-20 16:41:18 +00:00
2017-09-12 19:22:08 +00:00
2017-09-12 19:22:08 +00:00
2017-09-12 19:22:08 +00:00
2017-09-12 19:22:08 +00:00
2017-09-12 19:22:08 +00:00
2017-09-12 19:22:08 +00:00
2017-09-12 19:22:08 +00:00
2017-08-21 00:59:34 -07:00
2017-08-29 16:45:25 -07:00
2017-08-21 00:59:34 -07:00
2017-08-21 00:59:34 -07:00
2018-02-09 14:09:39 +00:00
2017-08-21 00:59:34 -07:00
2017-08-21 00:59:34 -07:00
2017-08-21 00:59:34 -07:00
2020-03-17 00:39:31 +00:00
2017-08-21 00:59:34 -07:00
2017-08-21 00:59:34 -07:00
2017-08-21 00:59:34 -07:00
2017-08-21 00:59:34 -07:00
2018-01-31 22:20:38 +00:00
2018-03-21 10:49:09 +00:00
2020-09-25 10:37:00 +00:00
2017-09-20 15:46:06 +00:00
2017-08-21 00:59:34 -07:00
2017-08-21 00:59:34 -07:00
2018-02-17 00:30:56 +00:00
2017-08-21 00:59:34 -07:00
2020-04-25 00:00:37 +00:00
2017-08-29 16:22:07 -07:00
2017-08-29 16:22:07 -07:00
2017-08-29 16:22:07 -07:00
2017-08-29 16:22:07 -07:00
2017-08-29 16:22:07 -07:00
2017-08-29 16:22:07 -07:00
2017-08-29 16:22:07 -07:00
2017-08-29 16:22:07 -07:00
2018-07-16 16:19:15 +00:00
2018-02-08 10:16:00 +00:00
2018-02-08 10:16:00 +00:00
2018-02-08 10:16:00 +00:00
2017-08-30 06:46:35 -07:00
2020-03-25 00:24:33 +00:00
2020-03-25 00:24:33 +00:00
2020-03-25 00:24:33 +00:00
2017-08-30 06:46:35 -07:00
2018-06-25 19:43:14 +00:00
2020-03-25 00:24:33 +00:00
2017-08-30 06:46:35 -07:00
2017-08-30 06:46:35 -07:00
2017-08-30 06:46:35 -07:00
2017-08-30 06:46:35 -07:00
2018-02-01 21:49:49 +00:00
2018-02-01 21:49:49 +00:00
2018-02-01 21:49:49 +00:00
2017-08-30 06:46:35 -07:00
2017-08-30 06:46:35 -07:00
2017-08-30 06:46:35 -07:00
2017-08-30 06:46:35 -07:00
2017-08-30 06:46:35 -07:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2017-09-09 00:18:53 +00:00
2020-03-17 00:39:31 +00:00
2019-05-10 19:43:58 +00:00
2017-10-17 23:37:15 +00:00
2019-09-16 20:05:46 +00:00
2017-11-14 12:59:14 +00:00
2020-03-17 00:39:31 +00:00
2020-03-25 00:24:33 +00:00
2018-02-09 14:09:39 +00:00
2017-09-14 23:33:28 +00:00
2019-05-10 19:43:58 +00:00
2017-09-14 22:07:28 +00:00
2020-10-16 20:20:02 +00:00
2019-05-10 19:43:58 +00:00
2018-02-09 14:09:39 +00:00
2017-11-14 12:59:14 +00:00
2020-06-29 14:04:53 +00:00
2019-05-10 19:43:58 +00:00
2019-05-10 19:43:58 +00:00
2019-05-10 19:43:58 +00:00
2019-05-10 19:43:58 +00:00
2019-05-10 19:43:58 +00:00
2019-05-10 19:43:58 +00:00
2019-05-10 19:43:58 +00:00
2019-05-10 19:43:58 +00:00
2019-05-10 19:43:58 +00:00
2019-05-10 19:43:58 +00:00
2019-05-10 19:43:58 +00:00
2020-03-25 00:24:33 +00:00
2019-05-10 19:43:58 +00:00
2018-09-11 11:07:01 +00:00
2020-03-19 23:31:30 +00:00
2019-05-10 19:43:58 +00:00
2019-05-10 19:43:58 +00:00
2018-09-18 21:11:10 +00:00
2017-09-20 19:29:01 +00:00
2019-05-20 12:44:05 +00:00
2017-09-20 19:29:01 +00:00
2019-07-08 13:38:54 +00:00
2017-11-14 12:59:14 +00:00
2020-03-25 00:24:33 +00:00
2019-05-10 19:43:58 +00:00
2018-01-31 22:20:38 +00:00
2020-02-15 02:40:00 +00:00
2019-05-10 19:43:58 +00:00
2018-01-31 22:20:38 +00:00
2019-05-10 19:43:58 +00:00
2017-09-11 13:52:19 +00:00
2020-03-17 00:39:31 +00:00
2017-11-14 12:59:14 +00:00
2017-11-14 12:59:14 +00:00
2017-11-14 12:59:14 +00:00
2017-11-14 12:59:14 +00:00
2017-11-14 12:59:14 +00:00
2017-11-14 12:59:14 +00:00
2017-11-14 12:59:14 +00:00
2017-11-14 12:59:14 +00:00
2017-11-14 12:59:14 +00:00
2017-09-20 15:46:06 +00:00
2017-11-14 12:59:14 +00:00
2017-09-11 18:24:02 +00:00
2017-11-14 12:59:14 +00:00
2017-11-14 12:59:14 +00:00
2017-11-14 12:59:14 +00:00
2017-11-14 12:59:14 +00:00
2017-11-14 12:59:14 +00:00
2018-01-31 22:20:38 +00:00
2017-11-14 12:59:14 +00:00