7d7c883890
Capture content of request/response. Changes about this cl: 1. The body of request will be written used by methods of `IOSink`. Each operation will emit a single event on the same timeline task. Add() will accept List<int> and write() works with strings. The data will remain the same as what user has passed. With that being said, data coming from add() will show a list of integers and a string representation if write() is used. 2. The timeline of `HttpClientResponse` will be a child timeline of corresponding `HttpClientRequest`. It will be recorded only if parent request is recorded and logging flag is still set. If the flag is on after the request is sent, the response will not be monitored. 3. `HttpClientResponse` is simply a stream. The timeline starts when the response is received. But it is possible that users doesn't read the content and close the program. In this case, timeline never gets a proper close event. To have a close event, users has to call listen(). 4. This also fixes verify_http_time_line_test.dart. It was broken and not checking correct events because of a typo. Bug: https://github.com/dart-lang/sdk/issues/42952 Change-Id: I884db6405264a3ad9a03cecc8f5445dad4fb3e31 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157567 Commit-Queue: Zichang Guo <zichangguo@google.com> Reviewed-by: Ben Konyi <bkonyi@google.com>