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

Side by Side Diff: pkg/fletchc/lib/src/verbs/attach_verb.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « pkg/fletchc/lib/src/verbs/actions.dart ('k') | pkg/fletchc/lib/src/verbs/compile_verb.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE.md file.
4
5 library fletchc.verbs.attach_verb;
6
7 import 'infrastructure.dart';
8
9 import 'documentation.dart' show
10 attachDocumentation;
11
12 import '../worker/developer.dart' show
13 Address,
14 attachToVm,
15 parseAddress;
16
17 const Action attachAction = const Action(
18 attach, attachDocumentation, requiresSession: true,
19 requiredTarget: TargetKind.TCP_SOCKET);
20
21 Future<int> attach(AnalyzedSentence sentence, VerbContext context) {
22 Address address = parseAddress(sentence.targetName);
23 return context.performTaskInWorker(
24 new AttachTask(address.host, address.port));
25 }
26
27 class AttachTask extends SharedTask {
28 // Keep this class simple, see note in superclass.
29
30 final String host;
31
32 final int port;
33
34 const AttachTask(this.host, this.port);
35
36 Future<int> call(
37 CommandSender commandSender,
38 StreamIterator<ClientCommand> commandIterator) {
39 return attachTask(host, port);
40 }
41 }
42
43 Future<int> attachTask(String host, int port) async {
44 SessionState state = SessionState.current;
45
46 // Cleanup previous session if any.
47 await state.terminateSession();
48
49 state.explicitAttach = true;
50 await attachToVm(host, port, state);
51 return 0;
52 }
OLDNEW
« no previous file with comments | « pkg/fletchc/lib/src/verbs/actions.dart ('k') | pkg/fletchc/lib/src/verbs/compile_verb.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698