Commit graph

1290 commits

Author SHA1 Message Date
Brian Quinlan 97d8445e5f Revert "[io] Fix a bug where Process.stdin.add exceptions could not be caught"
This reverts commit 9967075787.

Reason for revert: Ignoring `done` is asymmetrical with other IOSinks.

Original change's description:
> [io] Fix a bug where Process.stdin.add exceptions could not be caught
>
> Change-Id: I2383a74bfa6950ab8f8934087fb68218f06dd681
> Bug:https://github.com/dart-lang/sdk/issues/48501
> Tested: Unit test
> CoreLibraryReviewExempt: dart:io only
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351380
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Brian Quinlan <bquinlan@google.com>

Bug: https://github.com/dart-lang/sdk/issues/48501
Change-Id: Ib5356c640d4dddc30e561b9d60d93f794a935103
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359680
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-03-25 21:03:12 +00:00
Brian Quinlan c771931f6b [doc, io] Document the error behavior for File.openRead/file.openWrite
I recently fixed a bug by adding a `sink.done.ignore()` into library code: https://dart-review.googlesource.com/c/sdk/+/351380

My thinking now is that is a bad idea because it allows errors to pass silently if the sink is not closed or flushed (and the results are awaited!). Instead, we should document this as a general pattern for sinks.

...but that isn't satisfying either. `sink.done.ignore()` really means "I promise that I will handle errors elsewhere" but there is no actual enforcement of that.

Bug:https://github.com/dart-lang/sdk/issues/54707
Change-Id: I92feb43b1b2c57933c2343f4b6d354792cd13d72
CoreLibraryReviewExempt: dart io documentation-only
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352442
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-03-14 22:43:32 +00:00
Derek Xu f7c2ef5bb8 Account for changes to package:http_profile in _createHttpProfileRequestFromProfileMap
See the changes made to http_client_request_profile.dart in
https://github.com/dart-lang/http/pull/1154/files

TEST=The "using HttpClientRequestProfile.requestData.bodySink" and
"using HttpClientRequestProfile.responseData.bodySink" test cases in
package:http_profile

CoreLibraryReviewExempt: This CL does not include any API changes, only
implementation changes
Change-Id: Ia91ea2e7fb287271d8d7ec2b9f3bff3168d57d6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356560
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-03-08 21:32:15 +00:00
maBarabas 42ccd79cd1 Fix typo
Closes https://github.com/dart-lang/sdk/pull/55065

GitOrigin-RevId: ac11d63f223361219d5907b106f9672b4fa44b52
Change-Id: I7f8d816491707c86743adca04ef410cd9b60c8cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355200
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2024-03-02 03:48:55 +00:00
Brian Quinlan 770f44d4e9 [io] Make it possible to change the line ending output by stdout and stderr.
There is a performance impact in:
`stdout.lineTerminator = "\r\n";`

For small writes (<100 chars), the performance loss is lost in the noise of the `write` system call.

For writes of ~500 chars, the performance is about half of that without line terminator translation. But, on a M2 Mac laptop, ~80M characters can be written per second.

Bug: https://github.com/dart-lang/sdk/issues/53161
Change-Id: Icfa0f981dcf6edb856d8aac5e0e270bc0148d498
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326761
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-02-16 20:06:03 +00:00
Derek Xu 628d744391 [dart:developer][VM/Service] Add APIs to dart:developer for recording HTTP profiling information, and for later retrieving that information
The APIs mentioned above are `addHttpClientProfilingData` and
`getHttpClientProfilingData`.

This CL also makes it so that profiling information recorded using
`addHttpClientProfilingData` is included in dart:io service extension
responses.

TEST= pkg/vm_service/test/get_http_profile_test.dart

Change-Id: I892a7a8485369bb92cbb0c086b93498bcec25d5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341440
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-02-15 18:56:08 +00:00
Brian Quinlan 9967075787 [io] Fix a bug where Process.stdin.add exceptions could not be caught
Change-Id: I2383a74bfa6950ab8f8934087fb68218f06dd681
Bug:https://github.com/dart-lang/sdk/issues/48501
Tested: Unit test
CoreLibraryReviewExempt: dart:io only
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351380
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-02-13 18:26:49 +00:00
Derek Xu 60833d9cd9 [VM/Service] Update dart:io service extension spec
The main purpose of these changes is to make sure that the types in
package:http_profile are compatible with the interfaces in the spec.

See runtime/vm/service/service_extension.md and
pkg/vm_service/CHANGELOG.md for the full list of changes.

TEST=pkg/vm_service/test/get_http_profile_test.dart, DevTools tests

CoreLibraryReviewExempt: Only touches sdk/lib/io/network_profiling.dart
to update the version returned by the getVersion dart:io service
extension.
Change-Id: I1b9d0b7d43defbc857a2a8fde003012effd1ee15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341120
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-02-06 19:26:06 +00:00
Polina Cherkasova 166c796179 Implement toChunks and allow optimization.
1. Implement HeapSnapshotGraph.toChunks
2. Add parameter calculateReferrers, to allow to skip calculation of referrers, when they are not needed.

Change-Id: I312f01f1527e6b2bf4c8ddce6017ca6c53c8dd3a
CoreLibraryReviewExempt: minor dart:io documentation change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348802
Commit-Queue: Polina Cherkasova <polinach@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-02-06 16:55:20 +00:00
Brian Quinlan b325bc6a43 [doc,io]: Document how errors with File.openRead are exposed
Bug:https://github.com/dart-lang/sdk/issues/53904
Change-Id: Ib457ceb62f6745753e047b5d8160bf6d50fa12cb
CoreLibraryReviewExempt: documentation-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346586
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-01-17 18:43:50 +00:00
Aravind 8945d1be75 [io] Changed Minimum Limit for Trimming File or Dir Path in Windows
Closes https://github.com/dart-lang/sdk/pull/54536

GitOrigin-RevId: 9d8b1eafac9a6ff88f5277826dff1e51236b661c
Change-Id: Id65f5778a4173be3d253398c0c030d322c1b42df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345201
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-01-11 10:53:09 +00:00
osama 9329f7bad7 fix tiny typo in lib/io/file.dart
Closes https://github.com/dart-lang/sdk/pull/54562

GitOrigin-RevId: f3b2502c0124f287f3eccc021c5f1623839ae3d7
Change-Id: I6af749c16a5358e910bc883ef1ddfc65c30a0c3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345369
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-01-10 20:46:38 +00:00
James Lin 48ac398f11 Fix Directory.current setter compatibility with IOOverrides
The `Directory.current` setter has a `dynamic` parameter so that it
can accept either `String` or `Directory` arguments. (This is
asymmetric with the getter, which always returns a `Directory`.)

The corresponding `IOOverrides` callback, however, assumes that the
argument is always a `String`, and `Directory.current` passed its
`dynamic` argument through unchanged.  Consequently, overriding
the `Directory.current` setter would result in a `TypeError` when
setting `Directory.current` to a `Directory` object.

Changing `IOOverrides.setCurrentDirectory` to use a `dynamic`
parameter would be a breaking change, so instead make the
`Directory.current` setter check the argument's runtime type before
passing it along.

Bug: https://github.com/dart-lang/sdk/issues/52140
Change-Id: I3c5bba6b442b314c798bd7949dfeb5eb6251dc6e
CoreLibraryReviewExempt: No API changes and VM-only.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336604
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Auto-Submit: James Lin <jamesdlin@gmail.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-12-18 20:23:21 +00:00
Brian Quinlan 2cec317548 Document FileSystemEntity.delete when the type of object on the file system does not match the FileSystemEntity type.
Bug:https://github.com/dart-lang/sdk/issues/53917
Change-Id: I71d95e36c193314afa1872de6e34b1b5a41d7bd9
CoreLibraryReviewExempt: Documentation-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335328
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-11-13 20:09:08 +00:00
Brian Quinlan a826354365 Document that writeAsBytes truncates values beyond 0..255
Closes https://github.com/dart-lang/sdk/pull/53782

GitOrigin-RevId: 5453268e4ebad23c4085efbab78b53cec551930d
Change-Id: I7804cbe65c93bc34f56db6da7bc68aa1ef4e9303
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330944
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-11-10 23:54:40 +00:00
Nate Bosch 0801939ef4 Mention detached processes in exitCode doc
In response to #35874

The class level doc mentions the restriction that `exitCode` is
unavailable for detached processes. Repeat this in the doc for that
member since it is the API where it is the most relevant.

Change-Id: I14ca7bd32614b1d1c1ae4a7d96d87428215d3dd7
CoreLibraryReviewExempt: Doc change.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334360
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2023-11-07 21:56:55 +00:00
Brian Quinlan 942e897bf5 [doc/io] Add a RawSocketEvent example.
Bug: https://github.com/dart-lang/sdk/issues/33721
Change-Id: I4e8f35cec8d3e689469a63826d118cfa2fe42218
CoreLibraryReviewExempt: Documentation-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277701
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-10-30 16:53:17 +00:00
Brian Quinlan c31b4c0ef5 [doc/io] Minor Link.create documentation fixes.
Change-Id: I50932e9cd0c26b2070dd2930866f3fb18bc80763
CoreLibraryReviewExempt: documentation-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332483
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-10-27 17:25:40 +00:00
Brian Quinlan 097c84f11b [io/doc/test] Modify the Windows symlink resolution behavior so that resolving a link that points to a non-existent file results in a type of notFound, which is consistent with all other platforms.
Bug:https://github.com/dart-lang/sdk/issues/53684
Change-Id: I1b594e1a85906d1f510358eec71792ea15ab801b
CoreLibraryReviewExempt: VM- and doc-only
Tested: unit tests
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331841
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-10-25 23:14:38 +00:00
sgrekhov 79d359ed45 [io/doc] Fix typo in File.createSync() documentation
Change-Id: Id077d3c56b6e9835821cf9d4463df34c626ffb32
CoreLibraryReviewExempt: documentation update
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331920
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-10-25 19:11:30 +00:00
Brian Quinlan 4122919684 Remove documentation that indicates that the maximum received datagram size is 64K.
Bug:https://github.com/dart-lang/sdk/issues/31733
CoreLibraryReviewExempt:documentation-only
Change-Id: Icde611deb9a0172a5caacf518e9ce01904baf8ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331422
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-10-23 19:37:40 +00:00
Sergey G. Grekhov 09fc3f9554 [io/doc] Improve Link.createSync() documentation
Change-Id: I70c593ca2b7f9ba6b7cc94886f622f4af5dd20fd
CoreLibraryReviewExempt: documentation update
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330620
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-10-23 19:15:57 +00:00
Kenzie Schmoll 112c08b418 Remove deprecated APIs from dart_io_extensions.dart and add new is*Available RPCs.
Removed:
- `startSocketProfiling`
- `pauseSocketProfiling`
- `getHttpEnableTimelineLogging`
- `setHttpEnableTimelineLogging`

Added:
- `isSocketProfilingAvailable`
- `isHttpTimelineLoggingAvailable`
- `isHttpProfilingAvailable`

The added RPCs were previously implemented in DevTools with a TODO to move these into `dart_io_extensions.dart`: https://github.com/flutter/devtools/blob/master/packages/devtools_app/lib/src/service/vm_service_wrapper.dart#L896-L918

Change-Id: Ic6c14ae7c09361e39fb3b0ad8c28e3e5863ca9bb
CoreLibraryReviewExempt: VM service changes
TEST=existing tests
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329800
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-10-11 22:22:12 +00:00
Sergey G. Grekhov f05bf93d3f [io/doc] Update Link.createSync() documentation to be in accordance with Link.create()
Bug: https://github.com/dart-lang/sdk/issues/30665
Bug: https://github.com/dart-lang/sdk/issues/52972
Change-Id: I7e0ef87151bee7b371335933bd1b8ab1ebd72e52
CoreLibraryReviewExempt: documentation update
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329321
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-10-11 14:24:38 +00:00
Brian Quinlan 2b137b4e1f [io/doc] Make FileSystemEvent.toString() consistent across subclasses.
Change-Id: I76bbe9b58bdee5594917410c69513160f25e519e
CoreLibraryReviewExempt: Only changes `toString`
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329641
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-10-10 19:19:25 +00:00
Brian Quinlan 3fae23ae69 [io/doc] Document when read/readSync can return return less than requested bytes
Bug:https://github.com/dart-lang/sdk/issues/50034
Change-Id: Ib2f2b11bc3ae1fe241b71a43f2866233e066d8e2
CoreLibraryReviewExempt: Documentation-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/328802
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-09-29 21:21:38 +00:00
Brian Quinlan c3168c4e3b Clarify that Links on Windows have types and that the target of the symlink need not exist.
CoreLibraryReviewExempt: documentation-only change
Bug: https://github.com/dart-lang/sdk/issues/30665
Bug: https://github.com/dart-lang/sdk/issues/52972
Change-Id: Ia7f02fb578d67e78dd8209d7514db0436142a085
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/328661
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-09-29 16:22:33 +00:00
Piotr Rogowski a1692e3f26 Fix typos in socket send docs
Closes https://github.com/dart-lang/sdk/pull/53651

GitOrigin-RevId: 32ed388818bff0f0ed41b0bf44da3f3c4cff533e
Change-Id: I47dacf24ff3f2c9b7c8be637beb479559009ce82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/328680
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-09-29 14:04:41 +00:00
Brian Quinlan 2786aeec3e [doc/io] Sync Directory.rename()/renameSync()
Change-Id: Iff214619ceda27a0dfd768d515a4dcab250b9eb9
CoreLibraryReviewExempt: Documentation-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327521
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-09-25 20:42:53 +00:00
Brian Quinlan 5b7b8aab40 [docs/io]: Clarify the semantics of FileSystemEntity.rename(Sync).
CoreLibraryReviewExempt: Documentation-only change
Bug: https://github.com/dart-lang/sdk/issues/53274
Change-Id: Ifa3e94c6d8503790d3f6d29e9a99700e83d511d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326862
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-09-19 19:29:07 +00:00
Brian Quinlan f0632629c3 [io/doc]: Provide more references to SocketOption.tcpNoDelay.
Bug: https://github.com/dart-lang/sdk/issues/52102
Change-Id: I759735acfb0a67a3c0e359d6cf4c0ecab97c6c2a
CoreLibraryReviewExempt: doc-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325443
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-09-12 18:15:08 +00:00
Ryan Macnak 54faa31964 [standalone, io] Don't register service extensions in product mode.
dart2js.aot.x64 20942544 -> 20852448 (-90k)

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/45469
CoreLibraryReviewExempt: VM-only
Change-Id: I5ee6a4019af1fa4a0815ac05a42bb4883d74d8a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323503
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-08-30 21:46:17 +00:00
Martin Kustermann 11d820890e Use utf8.encode() instead of longer const Utf8Encoder.convert()
The change in [0] has propagated now everywhere, so we can use
`utf8.encode()` instead of the longer `const Utf8Encoder.convert()`.

As the checked-in SDK has been rolled to include [0] we can now rely on
the better return type.

[0] https://github.com/dart-lang/sdk/issues/52801

TEST=ci

CoreLibraryReviewExempt: Minor cleanup.
Change-Id: I2c0144023e03b2c265582d83a7fb9469b02f1570
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313563
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-07-24 09:28:38 +00:00
Lasse R.H. Nielsen 1861faef4a Make _IOOverridesScope have final fields.
Because it can, and therefore should.

Also update the methods to use `??` more, which should be
safe now that unsound null safety is no longer a thing.

Avoid chains of override-scopes by inlining the parts of the
outer scope which is not overridden.

Fix two bugs:
* `statSync` was checking whether `_stat` was non-`null`, then
  calling `_statSync`.
* `socketConncet` did not pass source port to function.

CoreLibraryReviewExempt: Affects only VM.
Change-Id: I9d4971271305c52948d334f69ae71d750587ed97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314880
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2023-07-20 10:11:58 +00:00
fzyzcjy ab2d19c93d Tiny code cleanup: Remove _asyncRunZoned being an alias of runZoned
Closes https://github.com/dart-lang/sdk/pull/52778

GitOrigin-RevId: 025405feaea425604513cf1863a1d3fc9d795292
Change-Id: I70bb5e04996a9f1939571a41e1f41ab0e6c38e6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311157
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-07-11 11:37:57 +00:00
Nate Bosch 8debcecb85 Mention that IOSink truncates List<int> to bytes
Closes #31670

In `add` and `addStream` mention that int values which are too large are
truncated to bytes.

R=lrn@google.com

Change-Id: Idf276fc65592e21766659e9d89dd687c441b7357
CoreLibraryReviewExempt: Doc changes only.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310768
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2023-06-27 19:39:01 +00:00
Nate Bosch 915c1ed9bc Change some "function" to "method" in IOSink docs
Closes #31722

R=lrn@google.com

Change-Id: Ice7ed1c1ffcc8468f8e61274fa3c4fa880cc04f6
CoreLibraryReviewExempt: Doc changes only.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310763
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-06-22 18:00:13 +00:00
Aryan More 4d67646eae Removed Non Null Check
Closes https://github.com/dart-lang/sdk/pull/52666

GitOrigin-RevId: 58fb6e98a3f7feb6c7ba933fdbfc408f26ecc6f5
Change-Id: I2f564067475ae68d4d9d18e4c3aafbdee40ed027
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308421
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-06-15 13:01:25 +00:00
Brian Quinlan 95509b2b34 Add tests to ensure that \n is not translated to the platform line ending and document that behavior.
Change-Id: I52668a87507dfdc560fd7c1ec20e86114c1199b7
CoreLibraryReviewExempt: documentation and test-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303421
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-05-24 18:50:29 +00:00
Lasse R.H. Nielsen 7e56658645 Add interface to a few classes which had missed it.
Breaking change request: https://dartbug.com/52334

Four abstract pure-interface classes in `stream.dart` have
been missed, and not made into `interface` declarations
like other similar abstract interface-only classes.
They should be marked `interface`, for consistency,
and to express intent.

The classes are:
* `StreamConsumer`
* `StreamIterator`
* `StreamTransformer`
* `MultiStreamController`

All are abstract classes with only abstract instance members.

Only `StreamConsumer` has uses where it is extended.
Most of those are inside the SDK, and are fixed here.
Two more are in packages (`http_server` and `streams`).
The former is discontinued and archived, and will never have a 3.0
release. The latter is internally developed and easy to fix.

Hope to cherry pick this for 3.0.3

Tested: Modified affected tests. Only adding restrictions.
CoreLibraryReviewExempt: Adding modifiers only.
Change-Id: I41aa47e48eaf769b7bd9d3206c1079a16ef3d476
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302204
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-05-24 14:04:27 +00:00
Brian Quinlan c3e815bc7a [io] Make FileSystemEvent sealed
Bug: https://github.com/dart-lang/sdk/issues/52027, https://github.com/dart-lang/sdk/issues/51912
Change-Id: I154ffe5901e4248f48400e6c84568c9fe6dbcd83
CoreLibraryReviewExempt: aske on holiday
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302452
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-05-22 23:37:31 +00:00
Nate Bosch 17c626f8b3 Remove some getters for final fields
These were original getters without any fields. After adding fields
to cache the values instead of rereading them on each access the
forwarding public getters became redundant but were not removed.

Make the fields public, remove the getters, and move the docs from the
getters to the fields.

Change-Id: Ie078f5b85cf85f8f86642ac6fe8d36f4107602ee
CoreLibraryReviewExempt: Only impacts VM platform.
Tested:No behavior changes expected. Confirmed updated fields can be read on VM.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304324
Reviewed-by: Siva Annamalai <asiva@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2023-05-19 00:52:57 +00:00
Brian Quinlan ee0b9ea0f8 Deprecate the Platform constructor
Bug:https://github.com/dart-lang/sdk/issues/52138
Change-Id: I9137ffe7caa1a1e9441d48b030342a528d99e8f6
CoreLibraryReviewExempt: deprecation, aske on holiday
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303086
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-05-18 21:08:24 +00:00
Brian Quinlan a75e857df5 Add a Platform.lineTerminator static method
Bug: https://github.com/dart-lang/sdk/issues/52379
Change-Id: Ic3a7f06252f8a69dcfdb29c00f16557c34529652
CoreLibraryReviewExempt: Aske is on holiday
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297260
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-05-18 19:57:58 +00:00
Sun Jiao f9ccf90c97 [http] support SameSite in Cookies.
Closes https://github.com/dart-lang/sdk/pull/51457

GitOrigin-RevId: 4e0bece11ae2c1b7b7eac5a43293ae43682e22d2
Change-Id: I0fe39aede037b713b5a3fdbf7950a4a44a02ea1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283984
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-05-02 23:51:22 +00:00
Alex Li fae49c0514 Improve comments of Directory methods
Closes https://github.com/dart-lang/sdk/pull/52194

GitOrigin-RevId: d6684f771db36b917b30d789785f3f883a76fad3
Change-Id: Ie6a172e7bf818368fe5557fec8b7b9eb1e7de8b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298841
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2023-04-27 09:40:30 +00:00
Brian Quinlan 69f71e90ea Remove 'abstract' from 'class Platform'
Bug: https://github.com/dart-lang/sdk/issues/52138
Change-Id: Ibef54f5369d4b9374e9d58939ee26c853021bf74
CoreLibraryReviewExempt: Partial revert of 9c702bc72e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297160
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-04-21 23:44:29 +00:00
Brian Quinlan 31095d70c6 Additional dart:io class modifier changes.
Change-Id: Ic6990835088e1c5052f2e556c73c04bb3ee98b8f
Tested: class type changes
CoreLibraryReviewExempt: Aske is on holiday
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292160
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-04-04 21:08:07 +00:00
Brian Quinlan 9c702bc72e Add Dart 3 class modifiers to dart:io.
Change-Id: Ia6eda18bb4ad6ae9f2705846e262f793f73d1e4f
Tested: class type changes
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291343
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-04-04 19:06:21 +00:00
Brian Quinlan 17ea08c10c Document that IPv4 are preferred in socket.connect.
Bug: https://github.com/dart-lang/sdk/issues/50868
Change-Id: I8186d95d1a24c77c4cfade533af26695c7a13b24
CoreLibraryReviewExempt: documentation-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293020
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-04-03 23:48:13 +00:00