forked from firka/flutter
This reverts commit cce6b3c5ae.
This commit is contained in:
@@ -112,7 +112,6 @@ abstract class ResidentWebRunner extends ResidentRunner {
|
||||
ConnectionResult _connectionResult;
|
||||
StreamSubscription<vmservice.Event> _stdOutSub;
|
||||
StreamSubscription<vmservice.Event> _stdErrSub;
|
||||
StreamSubscription<vmservice.Event> _extensionEventSub;
|
||||
bool _exited = false;
|
||||
WipConnection _wipConnection;
|
||||
ChromiumLauncher _chromiumLauncher;
|
||||
@@ -151,7 +150,6 @@ abstract class ResidentWebRunner extends ResidentRunner {
|
||||
}
|
||||
await _stdOutSub?.cancel();
|
||||
await _stdErrSub?.cancel();
|
||||
await _extensionEventSub?.cancel();
|
||||
await device.device.stopApp(null);
|
||||
try {
|
||||
_generatedEntrypointDirectory?.deleteSync(recursive: true);
|
||||
@@ -677,8 +675,6 @@ class _ResidentWebRunner extends ResidentWebRunner {
|
||||
final String message = utf8.decode(base64.decode(log.bytes));
|
||||
globals.printStatus(message, newline: false);
|
||||
});
|
||||
_extensionEventSub =
|
||||
_vmService.onExtensionEvent.listen(printStructuredErrorLog);
|
||||
try {
|
||||
await _vmService.streamListen(vmservice.EventStreams.kStdout);
|
||||
} on vmservice.RPCError {
|
||||
@@ -697,12 +693,6 @@ class _ResidentWebRunner extends ResidentWebRunner {
|
||||
// It is safe to ignore this error because we expect an error to be
|
||||
// thrown if we're not already subscribed.
|
||||
}
|
||||
try {
|
||||
await _vmService.streamListen(vmservice.EventStreams.kExtension);
|
||||
} on vmservice.RPCError {
|
||||
// It is safe to ignore this error because we expect an error to be
|
||||
// thrown if we're not already subscribed.
|
||||
}
|
||||
unawaited(_vmService.registerService('reloadSources', 'FlutterTools'));
|
||||
_vmService.registerServiceCallback('reloadSources', (Map<String, Object> params) async {
|
||||
final bool pause = params['pause'] as bool ?? false;
|
||||
|
||||
@@ -184,7 +184,6 @@ class FlutterDevice {
|
||||
CompileExpression compileExpression,
|
||||
ReloadMethod reloadMethod,
|
||||
GetSkSLMethod getSkSLMethod,
|
||||
PrintStructuredErrorLogMethod printStructuredErrorLogMethod,
|
||||
}) {
|
||||
final Completer<void> completer = Completer<void>();
|
||||
StreamSubscription<void> subscription;
|
||||
@@ -204,7 +203,6 @@ class FlutterDevice {
|
||||
compileExpression: compileExpression,
|
||||
reloadMethod: reloadMethod,
|
||||
getSkSLMethod: getSkSLMethod,
|
||||
printStructuredErrorLogMethod: printStructuredErrorLogMethod,
|
||||
device: device,
|
||||
);
|
||||
} on Exception catch (exception) {
|
||||
@@ -1057,23 +1055,11 @@ abstract class ResidentRunner {
|
||||
final String copyPath = getDefaultCachedKernelPath(
|
||||
trackWidgetCreation: trackWidgetCreation,
|
||||
);
|
||||
globals.fs
|
||||
.file(copyPath)
|
||||
.parent
|
||||
.createSync(recursive: true);
|
||||
globals.fs.file(copyPath).parent.createSync(recursive: true);
|
||||
outputDill.copySync(copyPath);
|
||||
}
|
||||
}
|
||||
|
||||
void printStructuredErrorLog(vm_service.Event event) {
|
||||
if (event.extensionKind == 'Flutter.Error') {
|
||||
final Map<dynamic, dynamic> json = event.extensionData?.data;
|
||||
if (json != null && json.containsKey('renderedErrorText')) {
|
||||
globals.printStatus('\n${json['renderedErrorText']}');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// If the [reloadSources] parameter is not null the 'reloadSources' service
|
||||
/// will be registered.
|
||||
//
|
||||
@@ -1098,8 +1084,7 @@ abstract class ResidentRunner {
|
||||
restart: restart,
|
||||
compileExpression: compileExpression,
|
||||
reloadMethod: reloadMethod,
|
||||
getSkSLMethod: getSkSLMethod,
|
||||
printStructuredErrorLogMethod: printStructuredErrorLog,
|
||||
getSkSLMethod: getSkSLMethod
|
||||
);
|
||||
// This will wait for at least one flutter view before returning.
|
||||
final Status status = globals.logger.startProgress(
|
||||
|
||||
@@ -31,8 +31,6 @@ const int kIsolateReloadBarred = 1005;
|
||||
/// for [WebSocket]s (used by tests).
|
||||
typedef WebSocketConnector = Future<io.WebSocket> Function(String url, {io.CompressionOptions compression});
|
||||
|
||||
typedef PrintStructuredErrorLogMethod = void Function(vm_service.Event);
|
||||
|
||||
WebSocketConnector _openChannel = _defaultOpenChannel;
|
||||
|
||||
/// The error codes for the JSON-RPC standard.
|
||||
@@ -151,7 +149,6 @@ typedef VMServiceConnector = Future<vm_service.VmService> Function(Uri httpUri,
|
||||
CompileExpression compileExpression,
|
||||
ReloadMethod reloadMethod,
|
||||
GetSkSLMethod getSkSLMethod,
|
||||
PrintStructuredErrorLogMethod printStructuredErrorLogMethod,
|
||||
io.CompressionOptions compression,
|
||||
Device device,
|
||||
});
|
||||
@@ -178,7 +175,6 @@ vm_service.VmService setUpVmService(
|
||||
Device device,
|
||||
ReloadMethod reloadMethod,
|
||||
GetSkSLMethod skSLMethod,
|
||||
PrintStructuredErrorLogMethod printStructuredErrorLogMethod,
|
||||
vm_service.VmService vmService
|
||||
) {
|
||||
if (reloadSources != null) {
|
||||
@@ -297,10 +293,6 @@ vm_service.VmService setUpVmService(
|
||||
});
|
||||
vmService.registerService('flutterGetSkSL', 'Flutter Tools');
|
||||
}
|
||||
if (printStructuredErrorLogMethod != null) {
|
||||
vmService.streamListen(vm_service.EventStreams.kExtension);
|
||||
vmService.onExtensionEvent.listen(printStructuredErrorLogMethod);
|
||||
}
|
||||
return vmService;
|
||||
}
|
||||
|
||||
@@ -319,7 +311,6 @@ Future<vm_service.VmService> connectToVmService(
|
||||
CompileExpression compileExpression,
|
||||
ReloadMethod reloadMethod,
|
||||
GetSkSLMethod getSkSLMethod,
|
||||
PrintStructuredErrorLogMethod printStructuredErrorLogMethod,
|
||||
io.CompressionOptions compression = io.CompressionOptions.compressionDefault,
|
||||
Device device,
|
||||
}) async {
|
||||
@@ -332,7 +323,6 @@ Future<vm_service.VmService> connectToVmService(
|
||||
device: device,
|
||||
reloadMethod: reloadMethod,
|
||||
getSkSLMethod: getSkSLMethod,
|
||||
printStructuredErrorLogMethod: printStructuredErrorLogMethod,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -343,7 +333,6 @@ Future<vm_service.VmService> _connect(
|
||||
CompileExpression compileExpression,
|
||||
ReloadMethod reloadMethod,
|
||||
GetSkSLMethod getSkSLMethod,
|
||||
PrintStructuredErrorLogMethod printStructuredErrorLogMethod,
|
||||
io.CompressionOptions compression = io.CompressionOptions.compressionDefault,
|
||||
Device device,
|
||||
}) async {
|
||||
@@ -365,7 +354,6 @@ Future<vm_service.VmService> _connect(
|
||||
device,
|
||||
reloadMethod,
|
||||
getSkSLMethod,
|
||||
printStructuredErrorLogMethod,
|
||||
delegateService,
|
||||
);
|
||||
_httpAddressExpando[service] = httpUri;
|
||||
|
||||
Reference in New Issue
Block a user