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

Side by Side Diff: runtime/bin/vmservice/client/lib/src/elements/action_link.dart

Issue 271153002: Add pause/resume for isolates in vmservice/observatory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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 file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library eval_link_element; 5 library action_link_element;
6 6
7 import 'package:observatory/service.dart'; 7 import 'package:observatory/service.dart';
8 import 'package:polymer/polymer.dart'; 8 import 'package:polymer/polymer.dart';
9 9
10 @CustomTag('eval-link') 10 @CustomTag('action-link')
11 class EvalLinkElement extends PolymerElement { 11 class ActionLinkElement extends PolymerElement {
12 EvalLinkElement.created() : super.created(); 12 ActionLinkElement.created() : super.created();
13 13
14 @observable bool busy = false; 14 @observable bool busy = false;
15 @published var callback = null; 15 @published var callback = null;
16 @published String expr = ''; 16 @published String label = 'action';
17 @published ServiceObject result = null;
18 17
19 void evalNow(var a, var b, var c) { 18 void doAction(var a, var b, var c) {
20 if (busy) { 19 if (busy) {
21 return; 20 return;
22 } 21 }
23 if (callback != null) { 22 if (callback != null) {
24 busy = true; 23 busy = true;
25 result = null; 24 // TODO(turnidge): Track down why adding a dummy argument makes
26 callback(expr).then((ServiceObject obj) { 25 // this work but having a no-argument callback doesn't.
27 result = obj; 26 callback(null).whenComplete(() {
28 }).whenComplete(() {
29 busy = false; 27 busy = false;
30 }); 28 });
31 } 29 }
32 } 30 }
33 } 31 }
OLDNEW
« no previous file with comments | « runtime/bin/vmservice/client/lib/elements.html ('k') | runtime/bin/vmservice/client/lib/src/elements/action_link.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698