Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: pkg/fletchc/lib/src/hub/client_commands.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/fletchc/lib/src/guess_configuration.dart ('k') | pkg/fletchc/lib/src/hub/exit_codes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/fletchc/lib/src/hub/client_commands.dart
diff --git a/pkg/fletchc/lib/src/hub/client_commands.dart b/pkg/fletchc/lib/src/hub/client_commands.dart
deleted file mode 100644
index 1376ac167f6656c781fa95cf7713bee7a64e7a3e..0000000000000000000000000000000000000000
--- a/pkg/fletchc/lib/src/hub/client_commands.dart
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE.md file.
-
-library fletchc.client_commands;
-
-import 'dart:io' show
- Socket;
-
-import 'dart:async' show
- StreamSubscription;
-
-import 'dart:typed_data' show
- Uint8List;
-
-import 'dart:convert' show
- UTF8;
-
-import '../console_print.dart' show
- printToConsole;
-
-import '../please_report_crash.dart' show
- stringifyError;
-
-enum ClientCommandCode {
- // Note: if you modify this enum, please modify src/tools/driver/connection.h
- // as well.
-
- /// Data on stdin.
- Stdin,
-
- /// Data on stdout.
- Stdout,
-
- /// Data on stderr.
- Stderr,
-
- /// Command-line arguments.
- Arguments,
-
- /// Unix process signal received.
- Signal,
-
- /// Set process exit code.
- ExitCode,
-
- /// Tell the receiver that commands will be processed immediatly.
- EventLoopStarted,
-
- /// Tell receiver to close the port this was sent to.
- ClosePort,
-
- /// A SendPort that the receiver can use to communicate with the sender.
- SendPort,
-
- /// The the receiver to perform a task.
- PerformTask,
-
- /// Error in connection.
- ClientConnectionError,
-
- /// Connection closed.
- ClientConnectionClosed,
-}
-
-class ClientCommand {
- final ClientCommandCode code;
- final data;
-
- ClientCommand(this.code, this.data);
-
- String toString() => 'ClientCommand($code, $data)';
-}
-
-abstract class CommandSender {
- void sendExitCode(int exitCode);
-
- void sendStdout(String data) {
- sendStdoutBytes(new Uint8List.fromList(UTF8.encode(data)));
- }
-
- void sendStdoutBytes(List<int> data) {
- sendDataCommand(ClientCommandCode.Stdout, data);
- }
-
- void sendStderr(String data) {
- sendStderrBytes(new Uint8List.fromList(UTF8.encode(data)));
- }
-
- void sendStderrBytes(List<int> data) {
- sendDataCommand(ClientCommandCode.Stderr, data);
- }
-
- void sendDataCommand(ClientCommandCode code, List<int> data);
-
- void sendClose();
-
- void sendEventLoopStarted();
-}
-
-Function makeErrorHandler(String info) {
- return (error, StackTrace stackTrace) {
- printToConsole("Error on $info: ${stringifyError(error, stackTrace)}");
- };
-}
-
-Socket handleSocketErrors(Socket socket, String name, {void log(String info)}) {
- String host = "?";
- String remotePort = "?";
- try {
- host = "${socket.remoteAddress.host}";
- remotePort = "${socket.remotePort}";
- } catch (_) {
- // Ignored, socket.remotePort may fail if the socket was closed on the
- // other side.
- }
- String info = "$name ${socket.port} -> $host:$remotePort";
- if (log != null) {
- log(info);
- }
- socket.done.catchError(makeErrorHandler(info));
- return socket;
-}
« no previous file with comments | « pkg/fletchc/lib/src/guess_configuration.dart ('k') | pkg/fletchc/lib/src/hub/exit_codes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698