e1d687cb9e
This CL migrates the `dwds` and `dwds_test_common` packages into the Dart SDK repository. Key Changes: - Migration: Moved source code and tests into `pkg/dwds` & `pkg/dwds_test_common`. - Linting and path resolution were updated in https://github.com/dart-lang/webdev/pull/2797, https://github.com/dart-lang/webdev/pull/2798 & https://github.com/dart-lang/webdev/pull/2799 to support both environments (webdev and sdk). Testing: - All tests passing locally. - CI try bots are green. Design Doc: http://goto.google.com/migrating-webdev and http://goto.google.com/migrating-dwds Fixes https://github.com/dart-lang/sdk/issues/62100 Fixes https://github.com/dart-lang/sdk/issues/62101 Fixes https://github.com/dart-lang/sdk/issues/62102 Fixes https://github.com/dart-lang/sdk/issues/62103 Cq-Include-Trybots: luci.dart.try:pkg-win-release-try,pkg-win-release-arm64-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-linux-release-try,pkg-linux-release-arm64-try,pkg-linux-debug-try Change-Id: Icc2bf9a86efb79d04a67053962a4548fe6e894f7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494640 Reviewed-by: Nicholas Shahan <nshahan@google.com> Reviewed-by: Nate Biggs <natebiggs@google.com> Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com> Reviewed-by: Ben Konyi <bkonyi@google.com> Reviewed-by: Mark Zhou <markzipan@google.com>
32 lines
1000 B
Dart
32 lines
1000 B
Dart
// Copyright (c) 2025, the Dart project authors. All rights reserved.
|
|
// Defines the request for service extension calls over WebSocket.
|
|
|
|
class ServiceExtensionRequest {
|
|
final String id;
|
|
final String method;
|
|
final Map<String, dynamic> args;
|
|
|
|
ServiceExtensionRequest({
|
|
required this.id,
|
|
required this.method,
|
|
Map<String, dynamic>? args,
|
|
}) : args = args ?? const <String, dynamic>{};
|
|
|
|
factory ServiceExtensionRequest.fromArgs({
|
|
required String id,
|
|
required String method,
|
|
required Map<String, dynamic> args,
|
|
}) => ServiceExtensionRequest(id: id, method: method, args: args);
|
|
|
|
factory ServiceExtensionRequest.fromJson(Map<String, dynamic> json) =>
|
|
ServiceExtensionRequest(
|
|
id: json['id'] as String,
|
|
method: json['method'] as String,
|
|
args:
|
|
(json['args'] as Map?)?.cast<String, dynamic>() ??
|
|
const <String, dynamic>{},
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {'id': id, 'method': method, 'args': args};
|
|
}
|