1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-03 00:08:46 +00:00

Reland "Remove SCREAMING dart:io networking APIs"

This is a reland of commit abfdc3d50f

Original change's description:
> Remove SCREAMING dart:io networking APIs
>
> Bug: https://github.com/dart-lang/sdk/issues/49140
> Change-Id: I50c6cca26597ee4d469b776fcec412ddfed760e1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246962
> Reviewed-by: Paul Berry <paulberry@google.com>
> Commit-Queue: Michael Thomsen <mit@google.com>

Bug: https://github.com/dart-lang/sdk/issues/49140
Change-Id: I64a4bdb69909dd864e84efae7dc423fc435e40ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247543
Reviewed-by: Oleh Prypin <oprypin@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
This commit is contained in:
Michael Thomsen 2022-06-08 16:57:32 +00:00 committed by Commit Bot
parent e63e4937e9
commit da050a2b16
4 changed files with 9 additions and 168 deletions

View File

@ -56,6 +56,11 @@ them, you must set the lower bound on the SDK constraint for your package to
#### `dart:io`
- **Breaking Change** [#34218](https://github.com/dart-lang/sdk/issues/34218):
Constants in `dart:io`'s networking APIs following the `SCREAMING_CAPS`
convention have been removed (they were previously deprecated). Please use
the corresponding `lowerCamelCase` constants instead.
- **Breaking Change** [#45630][]: The Dart VM no longer automatically restores
the initial terminal settings upon exit. Programs that change the `Stdin`
settings `lineMode` and `echoMode` are now responsible for restoring the

View File

@ -170,8 +170,8 @@ Evaluated: MapLiteral @ org-dartlang-testcase:///mock_http_headers.dart:13:7 ->
Evaluated: SymbolLiteral @ org-dartlang-testcase:///mock_http_headers.dart:13:7 -> SymbolConstant(#noFolding)
Evaluated: ListLiteral @ org-dartlang-testcase:///mock_http_headers.dart:13:7 -> ListConstant(const <Type*>[])
Evaluated: MapLiteral @ org-dartlang-testcase:///mock_http_headers.dart:13:7 -> MapConstant(const <Symbol*, dynamic>{})
Evaluated: SymbolLiteral @ org-dartlang-sdk:///sdk/lib/_http/http.dart:676:8 -> SymbolConstant(#clear)
Evaluated: ListLiteral @ org-dartlang-sdk:///sdk/lib/_http/http.dart:676:8 -> ListConstant(const <Type*>[])
Evaluated: ListLiteral @ org-dartlang-sdk:///sdk/lib/_http/http.dart:676:8 -> ListConstant(const <dynamic>[])
Evaluated: MapLiteral @ org-dartlang-sdk:///sdk/lib/_http/http.dart:676:8 -> MapConstant(const <Symbol*, dynamic>{})
Evaluated: SymbolLiteral @ org-dartlang-sdk:///sdk/lib/_http/http.dart:564:8 -> SymbolConstant(#clear)
Evaluated: ListLiteral @ org-dartlang-sdk:///sdk/lib/_http/http.dart:564:8 -> ListConstant(const <Type*>[])
Evaluated: ListLiteral @ org-dartlang-sdk:///sdk/lib/_http/http.dart:564:8 -> ListConstant(const <dynamic>[])
Evaluated: MapLiteral @ org-dartlang-sdk:///sdk/lib/_http/http.dart:564:8 -> MapConstant(const <Symbol*, dynamic>{})
Extra constant evaluation: evaluated: 268, effectively constant: 91

View File

@ -384,110 +384,10 @@ abstract class HttpHeaders {
static const warningHeader = "warning";
static const wwwAuthenticateHeader = "www-authenticate";
@Deprecated("Use acceptHeader instead")
static const ACCEPT = acceptHeader;
@Deprecated("Use acceptCharsetHeader instead")
static const ACCEPT_CHARSET = acceptCharsetHeader;
@Deprecated("Use acceptEncodingHeader instead")
static const ACCEPT_ENCODING = acceptEncodingHeader;
@Deprecated("Use acceptLanguageHeader instead")
static const ACCEPT_LANGUAGE = acceptLanguageHeader;
@Deprecated("Use acceptRangesHeader instead")
static const ACCEPT_RANGES = acceptRangesHeader;
@Deprecated("Use ageHeader instead")
static const AGE = ageHeader;
@Deprecated("Use allowHeader instead")
static const ALLOW = allowHeader;
@Deprecated("Use authorizationHeader instead")
static const AUTHORIZATION = authorizationHeader;
@Deprecated("Use cacheControlHeader instead")
static const CACHE_CONTROL = cacheControlHeader;
@Deprecated("Use connectionHeader instead")
static const CONNECTION = connectionHeader;
@Deprecated("Use contentEncodingHeader instead")
static const CONTENT_ENCODING = contentEncodingHeader;
@Deprecated("Use contentLanguageHeader instead")
static const CONTENT_LANGUAGE = contentLanguageHeader;
@Deprecated("Use contentLengthHeader instead")
static const CONTENT_LENGTH = contentLengthHeader;
@Deprecated("Use contentLocationHeader instead")
static const CONTENT_LOCATION = contentLocationHeader;
@Deprecated("Use contentMD5Header instead")
static const CONTENT_MD5 = contentMD5Header;
@Deprecated("Use contentRangeHeader instead")
static const CONTENT_RANGE = contentRangeHeader;
@Deprecated("Use contentTypeHeader instead")
static const CONTENT_TYPE = contentTypeHeader;
@Deprecated("Use dateHeader instead")
static const DATE = dateHeader;
@Deprecated("Use etagHeader instead")
static const ETAG = etagHeader;
@Deprecated("Use expectHeader instead")
static const EXPECT = expectHeader;
@Deprecated("Use expiresHeader instead")
static const EXPIRES = expiresHeader;
@Deprecated("Use fromHeader instead")
static const FROM = fromHeader;
@Deprecated("Use hostHeader instead")
static const HOST = hostHeader;
@Deprecated("Use ifMatchHeader instead")
static const IF_MATCH = ifMatchHeader;
@Deprecated("Use ifModifiedSinceHeader instead")
static const IF_MODIFIED_SINCE = ifModifiedSinceHeader;
@Deprecated("Use ifNoneMatchHeader instead")
static const IF_NONE_MATCH = ifNoneMatchHeader;
@Deprecated("Use ifRangeHeader instead")
static const IF_RANGE = ifRangeHeader;
@Deprecated("Use ifUnmodifiedSinceHeader instead")
static const IF_UNMODIFIED_SINCE = ifUnmodifiedSinceHeader;
@Deprecated("Use lastModifiedHeader instead")
static const LAST_MODIFIED = lastModifiedHeader;
@Deprecated("Use locationHeader instead")
static const LOCATION = locationHeader;
@Deprecated("Use maxForwardsHeader instead")
static const MAX_FORWARDS = maxForwardsHeader;
@Deprecated("Use pragmaHeader instead")
static const PRAGMA = pragmaHeader;
@Deprecated("Use proxyAuthenticateHeader instead")
static const PROXY_AUTHENTICATE = proxyAuthenticateHeader;
@Deprecated("Use proxyAuthorizationHeader instead")
static const PROXY_AUTHORIZATION = proxyAuthorizationHeader;
@Deprecated("Use rangeHeader instead")
static const RANGE = rangeHeader;
@Deprecated("Use refererHeader instead")
static const REFERER = refererHeader;
@Deprecated("Use retryAfterHeader instead")
static const RETRY_AFTER = retryAfterHeader;
@Deprecated("Use serverHeader instead")
static const SERVER = serverHeader;
@Deprecated("Use teHeader instead")
static const TE = teHeader;
@Deprecated("Use trailerHeader instead")
static const TRAILER = trailerHeader;
@Deprecated("Use transferEncodingHeader instead")
static const TRANSFER_ENCODING = transferEncodingHeader;
@Deprecated("Use upgradeHeader instead")
static const UPGRADE = upgradeHeader;
@Deprecated("Use userAgentHeader instead")
static const USER_AGENT = userAgentHeader;
@Deprecated("Use varyHeader instead")
static const VARY = varyHeader;
@Deprecated("Use viaHeader instead")
static const VIA = viaHeader;
@Deprecated("Use warningHeader instead")
static const WARNING = warningHeader;
@Deprecated("Use wwwAuthenticateHeader instead")
static const WWW_AUTHENTICATE = wwwAuthenticateHeader;
// Cookie headers from RFC 6265.
static const cookieHeader = "cookie";
static const setCookieHeader = "set-cookie";
@Deprecated("Use cookieHeader instead")
static const COOKIE = cookieHeader;
@Deprecated("Use setCookieHeader instead")
static const SET_COOKIE = setCookieHeader;
// TODO(39783): Document this.
static const generalHeaders = [
cacheControlHeader,
@ -501,9 +401,6 @@ abstract class HttpHeaders {
warningHeader
];
@Deprecated("Use generalHeaders instead")
static const GENERAL_HEADERS = generalHeaders;
static const entityHeaders = [
allowHeader,
contentEncodingHeader,
@ -517,9 +414,6 @@ abstract class HttpHeaders {
lastModifiedHeader
];
@Deprecated("Use entityHeaders instead")
static const ENTITY_HEADERS = entityHeaders;
static const responseHeaders = [
acceptRangesHeader,
ageHeader,
@ -532,9 +426,6 @@ abstract class HttpHeaders {
wwwAuthenticateHeader
];
@Deprecated("Use responseHeaders instead")
static const RESPONSE_HEADERS = responseHeaders;
static const requestHeaders = [
acceptHeader,
acceptCharsetHeader,
@ -557,9 +448,6 @@ abstract class HttpHeaders {
userAgentHeader
];
@Deprecated("Use requestHeaders instead")
static const REQUEST_HEADERS = requestHeaders;
/// The date specified by the [dateHeader] header, if any.
DateTime? date;
@ -773,29 +661,21 @@ abstract class ContentType implements HeaderValue {
///
/// text/plain; charset=utf-8
static final text = ContentType("text", "plain", charset: "utf-8");
@Deprecated("Use text instead")
static final TEXT = text;
/// Content type for HTML using UTF-8 encoding.
///
/// text/html; charset=utf-8
static final html = ContentType("text", "html", charset: "utf-8");
@Deprecated("Use html instead")
static final HTML = html;
/// Content type for JSON using UTF-8 encoding.
///
/// application/json; charset=utf-8
static final json = ContentType("application", "json", charset: "utf-8");
@Deprecated("Use json instead")
static final JSON = json;
/// Content type for binary data.
///
/// application/octet-stream
static final binary = ContentType("application", "octet-stream");
@Deprecated("Use binary instead")
static final BINARY = binary;
/// Creates a new content type object setting the primary type and
/// sub type. The charset and additional parameters can also be set
@ -1262,12 +1142,8 @@ abstract class HttpResponse implements IOSink {
/// client.findProxy = null;
abstract class HttpClient {
static const int defaultHttpPort = 80;
@Deprecated("Use defaultHttpPort instead")
static const int DEFAULT_HTTP_PORT = defaultHttpPort;
static const int defaultHttpsPort = 443;
@Deprecated("Use defaultHttpsPort instead")
static const int DEFAULT_HTTPS_PORT = defaultHttpsPort;
/// Enable logging of HTTP requests from all [HttpClient]s to the developer
/// timeline.

View File

@ -19,33 +19,6 @@ abstract class WebSocketStatus {
static const int missingMandatoryExtension = 1010;
static const int internalServerError = 1011;
static const int reserved1015 = 1015;
@Deprecated("Use normalClosure instead")
static const int NORMAL_CLOSURE = normalClosure;
@Deprecated("Use goingAway instead")
static const int GOING_AWAY = goingAway;
@Deprecated("Use protocolError instead")
static const int PROTOCOL_ERROR = protocolError;
@Deprecated("Use unsupportedData instead")
static const int UNSUPPORTED_DATA = unsupportedData;
@Deprecated("Use reserved1004 instead")
static const int RESERVED_1004 = reserved1004;
@Deprecated("Use noStatusReceived instead")
static const int NO_STATUS_RECEIVED = noStatusReceived;
@Deprecated("Use abnormalClosure instead")
static const int ABNORMAL_CLOSURE = abnormalClosure;
@Deprecated("Use invalidFramePayloadData instead")
static const int INVALID_FRAME_PAYLOAD_DATA = invalidFramePayloadData;
@Deprecated("Use policyViolation instead")
static const int POLICY_VIOLATION = policyViolation;
@Deprecated("Use messageTooBig instead")
static const int MESSAGE_TOO_BIG = messageTooBig;
@Deprecated("Use missingMandatoryExtension instead")
static const int MISSING_MANDATORY_EXTENSION = missingMandatoryExtension;
@Deprecated("Use internalServerError instead")
static const int INTERNAL_SERVER_ERROR = internalServerError;
@Deprecated("Use reserved1015 instead")
static const int RESERVED_1015 = reserved1015;
}
/// Options controlling compression in a [WebSocket].
@ -68,8 +41,6 @@ class CompressionOptions {
/// * `clientMaxWindowBits`: null (default maximal window size of 15 bits)
/// * `serverMaxWindowBits`: null (default maximal window size of 15 bits)
static const CompressionOptions compressionDefault = CompressionOptions();
@Deprecated("Use compressionDefault instead")
static const CompressionOptions DEFAULT = compressionDefault;
/// No-compression configuration.
///
@ -77,8 +48,6 @@ class CompressionOptions {
/// [WebSocket].
static const CompressionOptions compressionOff =
CompressionOptions(enabled: false);
@Deprecated("Use compressionOff instead")
static const CompressionOptions OFF = compressionOff;
/// Whether the client will reuse its compression instances.
final bool clientNoContextTakeover;
@ -300,15 +269,6 @@ abstract class WebSocket
static const int closing = 2;
static const int closed = 3;
@Deprecated("Use connecting instead")
static const int CONNECTING = connecting;
@Deprecated("Use open instead")
static const int OPEN = open;
@Deprecated("Use closing instead")
static const int CLOSING = closing;
@Deprecated("Use closed instead")
static const int CLOSED = closed;
/// The interval between ping signals.
///
/// A ping message is sent every [pingInterval], starting at the first