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

Side by Side Diff: runtime/observatory/lib/src/elements/script_inset.dart

Issue 979823003: Major rework of vm service events. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 script_inset_element; 5 library script_inset_element;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'observatory_element.dart'; 9 import 'observatory_element.dart';
10 import 'package:observatory/service.dart'; 10 import 'package:observatory/service.dart';
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 @CustomTag('breakpoint-toggle') 277 @CustomTag('breakpoint-toggle')
278 class BreakpointToggleElement extends ObservatoryElement { 278 class BreakpointToggleElement extends ObservatoryElement {
279 @published ScriptLine line; 279 @published ScriptLine line;
280 @observable bool busy = false; 280 @observable bool busy = false;
281 281
282 void toggleBreakpoint(var a, var b, var c) { 282 void toggleBreakpoint(var a, var b, var c) {
283 if (busy) { 283 if (busy) {
284 return; 284 return;
285 } 285 }
286 busy = true; 286 busy = true;
287 if (line.bpt == null) { 287 if (line.breakpoints == null) {
288 // No breakpoint. Add it. 288 // No breakpoint. Add it.
289 line.script.isolate.addBreakpoint(line.script, line.line).then((_) { 289 line.script.isolate.addBreakpoint(line.script, line.line).then((_) {
290 busy = false; 290 busy = false;
291 }); 291 });
292 } else { 292 } else {
293 // Existing breakpoint. Remove it. 293 // Existing breakpoint. Remove it.
294 line.script.isolate.removeBreakpoint(line.bpt).then((_) { 294 List pending = [];
295 busy = false; 295 for (var bpt in line.breakpoints) {
296 pending.add(line.script.isolate.removeBreakpoint(bpt));
297 }
298 Future.wait(pending).then((_) {
299 busy = false;
296 }); 300 });
297 } 301 }
298 } 302 }
299 303
300 BreakpointToggleElement.created() : super.created(); 304 BreakpointToggleElement.created() : super.created();
301 } 305 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/isolate_summary.html ('k') | runtime/observatory/lib/src/elements/script_inset.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698