Skip to content

Fix DCM errors in chrome_proxy_service.dart #2148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions dwds/lib/src/services/chrome_proxy_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ ${globalLoadStrategy.loadModuleSnippet}("dart_sdk").developer.invokeExtension(
String targetId,
String expression, {
Map<String, String>? scope,
// TODO(798) - respect disableBreakpoints.
bool? disableBreakpoints,
}) =>
wrapInErrorHandlerAsync(
Expand All @@ -589,7 +590,6 @@ ${globalLoadStrategy.loadModuleSnippet}("dart_sdk").developer.invokeExtension(
targetId,
expression,
scope: scope,
disableBreakpoints: disableBreakpoints,
),
);

Expand All @@ -598,7 +598,6 @@ ${globalLoadStrategy.loadModuleSnippet}("dart_sdk").developer.invokeExtension(
String targetId,
String expression, {
Map<String, String>? scope,
bool? disableBreakpoints,
}) {
// TODO(798) - respect disableBreakpoints.
return captureElapsedTime(
Expand Down Expand Up @@ -637,6 +636,7 @@ ${globalLoadStrategy.loadModuleSnippet}("dart_sdk").developer.invokeExtension(
int frameIndex,
String expression, {
Map<String, String>? scope,
// TODO(798) - respect disableBreakpoints.
bool? disableBreakpoints,
}) =>
wrapInErrorHandlerAsync(
Expand All @@ -646,7 +646,6 @@ ${globalLoadStrategy.loadModuleSnippet}("dart_sdk").developer.invokeExtension(
frameIndex,
expression,
scope: scope,
disableBreakpoints: disableBreakpoints,
),
);

Expand All @@ -655,7 +654,6 @@ ${globalLoadStrategy.loadModuleSnippet}("dart_sdk").developer.invokeExtension(
int frameIndex,
String expression, {
Map<String, String>? scope,
bool? disableBreakpoints,
}) {
// TODO(798) - respect disableBreakpoints.

Expand Down Expand Up @@ -908,6 +906,7 @@ ${globalLoadStrategy.loadModuleSnippet}("dart_sdk").developer.invokeExtension(
String targetId,
String selector,
List argumentIds, {
// TODO(798) - respect disableBreakpoints.
bool? disableBreakpoints,
}) =>
wrapInErrorHandlerAsync(
Expand All @@ -917,20 +916,17 @@ ${globalLoadStrategy.loadModuleSnippet}("dart_sdk").developer.invokeExtension(
targetId,
selector,
argumentIds,
disableBreakpoints: disableBreakpoints,
),
);

Future<Response> _invoke(
String isolateId,
String targetId,
String selector,
List argumentIds, {
bool? disableBreakpoints,
}) async {
List argumentIds,
) async {
await isInitialized;
_checkIsolate('invoke', isolateId);
// TODO(798) - respect disableBreakpoints.
final remote = await inspector.invoke(targetId, selector, argumentIds);
return _instanceRef(remote);
}
Expand Down Expand Up @@ -1001,14 +997,13 @@ ${globalLoadStrategy.loadModuleSnippet}("dart_sdk").developer.invokeExtension(
}) =>
wrapInErrorHandlerAsync(
'lookupResolvedPackageUris',
() => _lookupResolvedPackageUris(isolateId, uris, local: local),
() => _lookupResolvedPackageUris(isolateId, uris),
);

Future<UriList> _lookupResolvedPackageUris(
String isolateId,
List<String> uris, {
bool? local,
}) async {
List<String> uris,
) async {
await isInitialized;
_checkIsolate('lookupResolvedPackageUris', isolateId);
return UriList(uris: uris.map(DartUri.toResolvedUri).toList());
Expand Down Expand Up @@ -1140,24 +1135,22 @@ ${globalLoadStrategy.loadModuleSnippet}("dart_sdk").developer.invokeExtension(
Future<Success> setIsolatePauseMode(
String isolateId, {
String? exceptionPauseMode,
// TODO(elliette): Is there a way to respect the shouldPauseOnExit parameter
// in Chrome?
bool? shouldPauseOnExit,
}) =>
wrapInErrorHandlerAsync(
'setIsolatePauseMode',
() => _setIsolatePauseMode(
isolateId,
exceptionPauseMode: exceptionPauseMode,
shouldPauseOnExit: shouldPauseOnExit,
),
);

Future<Success> _setIsolatePauseMode(
String isolateId, {
String? exceptionPauseMode,
bool? shouldPauseOnExit,
}) async {
// TODO(elliette): Is there a way to respect the shouldPauseOnExit parameter
// in Chrome?
await isInitialized;
_checkIsolate('setIsolatePauseMode', isolateId);
return (await debuggerFuture)
Expand Down