Skip to content

Commit 2e895ad

Browse files
kenzieschmollCommit Bot
authored andcommitted
Remove duplicated devtools_shared code from dds.
Fixes flutter/devtools#3571. Change-Id: I168b44ef0e59a16695ce824499dff774ba46f3d1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239800 Reviewed-by: Ben Konyi <[email protected]> Commit-Queue: Kenzie Davisson <[email protected]>
1 parent e43fe55 commit 2e895ad

File tree

4 files changed

+6
-55
lines changed

4 files changed

+6
-55
lines changed

pkg/dds/lib/devtools_server.dart

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'dart:io';
77

88
import 'package:args/args.dart';
99
import 'package:browser_launcher/browser_launcher.dart';
10+
import 'package:devtools_shared/devtools_shared.dart';
1011
import 'package:http_multi_server/http_multi_server.dart';
1112
import 'package:path/path.dart' as path;
1213
import 'package:shelf/shelf.dart' as shelf;
@@ -291,7 +292,7 @@ class DevToolsServer {
291292
if (launchBrowser) {
292293
if (serviceProtocolUri != null) {
293294
serviceProtocolUri =
294-
_normalizeVmServiceUri(serviceProtocolUri).toString();
295+
normalizeVmServiceUri(serviceProtocolUri).toString();
295296
}
296297

297298
final queryParameters = {
@@ -674,23 +675,4 @@ class DevToolsServer {
674675
};
675676
return uri.hasPort && tunneledPorts.contains(uri.port);
676677
}
677-
678-
// TODO(https://github.com/flutter/devtools/issues/3571): move to devtools_shared.
679-
// Note: please keep this copy of normalizeVmServiceUri() in sync with the one
680-
// in devtools_app.
681-
Uri? _normalizeVmServiceUri(String value) {
682-
value = value.trim();
683-
684-
// Cleanup encoded urls likely copied from the uri of an existing running
685-
// DevTools app.
686-
if (value.contains('%3A%2F%2F')) {
687-
value = Uri.decodeFull(value);
688-
}
689-
final uri = Uri.parse(value.trim()).removeFragment();
690-
if (!uri.isAbsolute) {
691-
return null;
692-
}
693-
if (uri.path.endsWith('/')) return uri;
694-
return uri.replace(path: uri.path);
695-
}
696678
}

pkg/dds/lib/src/devtools/memory_profile.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import 'package:collection/collection.dart';
1212
import 'package:devtools_shared/devtools_shared.dart';
1313
import 'package:vm_service/vm_service.dart';
1414

15-
import 'service_registrations.dart' as service_registrations;
16-
1715
class MemoryProfile {
1816
MemoryProfile(this.service, String profileFilename, this._verboseMode) {
1917
onConnectionClosed.listen(_handleConnectionStop);
@@ -77,7 +75,7 @@ class MemoryProfile {
7775

7876
Future<Response?> getAdbMemoryInfo() async {
7977
return await callService(
80-
service_registrations.flutterMemory.service,
78+
flutterMemory.service,
8179
isolateId: _selectedIsolate.id,
8280
);
8381
}
@@ -221,7 +219,7 @@ class MemoryProfile {
221219
/// @throws Exception if no 'FlutterView'.
222220
Future<String?> getFlutterViewId(IsolateRef selectedIsolate) async {
223221
final flutterViewListResponse = await service!.callServiceExtension(
224-
service_registrations.flutterListViews,
222+
flutterListViews,
225223
isolateId: selectedIsolate.id,
226224
);
227225
final List<dynamic> views =
@@ -253,7 +251,7 @@ class MemoryProfile {
253251
final viewId = await getFlutterViewId(selectedIsolate);
254252

255253
return await service!.callServiceExtension(
256-
service_registrations.flutterEngineRasterCache,
254+
flutterEngineRasterCache,
257255
args: {'viewId': viewId},
258256
isolateId: selectedIsolate.id,
259257
);

pkg/dds/lib/src/devtools/service_registrations.dart

Lines changed: 0 additions & 29 deletions
This file was deleted.

pkg/dds/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies:
1616
browser_launcher: ^1.0.0
1717
collection: ^1.15.0
1818
dds_service_extensions: ^1.3.0
19-
devtools_shared: ^2.11.4
19+
devtools_shared: ^2.12.1
2020
http_multi_server: ^3.0.0
2121
json_rpc_2: ^3.0.0
2222
meta: ^1.1.8

0 commit comments

Comments
 (0)