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

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

Issue 2980733003: Introduced support for external services registration in the ServiceProtocol (Closed)
Patch Set: Address comments Created 3 years, 5 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 debugger_page_element; 5 library debugger_page_element;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'dart:math'; 9 import 'dart:math';
10 import 'dart:svg'; 10 import 'dart:svg';
11 11
12 import 'package:logging/logging.dart'; 12 import 'package:logging/logging.dart';
13 import 'package:observatory/app.dart'; 13 import 'package:observatory/app.dart';
14 import 'package:observatory/cli.dart'; 14 import 'package:observatory/cli.dart';
15 import 'package:observatory/debugger.dart'; 15 import 'package:observatory/debugger.dart';
16 import 'package:observatory/event.dart'; 16 import 'package:observatory/event.dart';
17 import 'package:observatory/models.dart' as M; 17 import 'package:observatory/models.dart' as M;
18 import 'package:observatory/service.dart' as S; 18 import 'package:observatory/service.dart' as S;
19 import 'package:observatory/repositories.dart' as R;
19 import 'package:observatory/src/elements/function_ref.dart'; 20 import 'package:observatory/src/elements/function_ref.dart';
20 import 'package:observatory/src/elements/helpers/any_ref.dart'; 21 import 'package:observatory/src/elements/helpers/any_ref.dart';
21 import 'package:observatory/src/elements/helpers/nav_bar.dart'; 22 import 'package:observatory/src/elements/helpers/nav_bar.dart';
22 import 'package:observatory/src/elements/helpers/nav_menu.dart'; 23 import 'package:observatory/src/elements/helpers/nav_menu.dart';
23 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; 24 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart';
24 import 'package:observatory/src/elements/helpers/tag.dart'; 25 import 'package:observatory/src/elements/helpers/tag.dart';
25 import 'package:observatory/src/elements/helpers/uris.dart'; 26 import 'package:observatory/src/elements/helpers/uris.dart';
26 import 'package:observatory/src/elements/instance_ref.dart'; 27 import 'package:observatory/src/elements/instance_ref.dart';
27 import 'package:observatory/src/elements/nav/isolate_menu.dart'; 28 import 'package:observatory/src/elements/nav/isolate_menu.dart';
28 import 'package:observatory/src/elements/nav/notify.dart'; 29 import 'package:observatory/src/elements/nav/notify.dart';
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 433
433 String helpShort = 'Rewind the stack to a previous frame'; 434 String helpShort = 'Rewind the stack to a previous frame';
434 435
435 String helpLong = 'Rewind the stack to a previous frame.\n' 436 String helpLong = 'Rewind the stack to a previous frame.\n'
436 '\n' 437 '\n'
437 'Syntax: rewind\n' 438 'Syntax: rewind\n'
438 ' rewind <count>\n'; 439 ' rewind <count>\n';
439 } 440 }
440 441
441 class ReloadCommand extends DebuggerCommand { 442 class ReloadCommand extends DebuggerCommand {
442 ReloadCommand(Debugger debugger) : super(debugger, 'reload', []); 443 final M.IsolateRepository _isolates;
444
445 ReloadCommand(Debugger debugger, this._isolates)
446 : super(debugger, 'reload', []);
443 447
444 Future run(List<String> args) async { 448 Future run(List<String> args) async {
445 try { 449 try {
446 if (args.length > 0) { 450 if (args.length > 0) {
447 debugger.console.print('reload expects no arguments'); 451 debugger.console.print('reload expects no arguments');
448 return; 452 return;
449 } 453 }
450 await debugger.isolate.reloadSources(); 454 if (_isolates.reloadSourcesServices.isEmpty) {
455 await _isolates.reloadSources(debugger.isolate);
456 } else {
457 await _isolates.reloadSources(debugger.isolate,
458 service: _isolates.reloadSourcesServices.first);
459 }
451 debugger.console.print('reload complete'); 460 debugger.console.print('reload complete');
452 await debugger.refreshStack(); 461 await debugger.refreshStack();
453 } on S.ServerRpcException catch (e) { 462 } on S.ServerRpcException catch (e) {
454 if (e.code == S.ServerRpcException.kIsolateReloadBarred || 463 if (e.code == S.ServerRpcException.kIsolateReloadBarred ||
455 e.code == S.ServerRpcException.kIsolateIsReloading) { 464 e.code == S.ServerRpcException.kIsolateIsReloading) {
456 debugger.console.printRed(e.data['details']); 465 debugger.console.printRed(e.data['details']);
457 } else { 466 } else {
458 rethrow; 467 rethrow;
459 } 468 }
460 } 469 }
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 new DeleteCommand(this), 1463 new DeleteCommand(this),
1455 new DownCommand(this), 1464 new DownCommand(this),
1456 new FinishCommand(this), 1465 new FinishCommand(this),
1457 new FrameCommand(this), 1466 new FrameCommand(this),
1458 new HelpCommand(this), 1467 new HelpCommand(this),
1459 new InfoCommand(this), 1468 new InfoCommand(this),
1460 new IsolateCommand(this), 1469 new IsolateCommand(this),
1461 new LogCommand(this), 1470 new LogCommand(this),
1462 new PauseCommand(this), 1471 new PauseCommand(this),
1463 new PrintCommand(this), 1472 new PrintCommand(this),
1464 new ReloadCommand(this), 1473 new ReloadCommand(this, new R.IsolateRepository(this.isolate.vm)),
1465 new RefreshCommand(this), 1474 new RefreshCommand(this),
1466 new RewindCommand(this), 1475 new RewindCommand(this),
1467 new SetCommand(this), 1476 new SetCommand(this),
1468 new SmartNextCommand(this), 1477 new SmartNextCommand(this),
1469 new StepCommand(this), 1478 new StepCommand(this),
1470 new SyncNextCommand(this), 1479 new SyncNextCommand(this),
1471 new UpCommand(this), 1480 new UpCommand(this),
1472 new VmCommand(this), 1481 new VmCommand(this),
1473 ], _history); 1482 ], _history);
1474 _consolePrinter = new _ConsoleStreamPrinter(this); 1483 _consolePrinter = new _ConsoleStreamPrinter(this);
(...skipping 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after
3343 ..setAttribute('height', '24') 3352 ..setAttribute('height', '24')
3344 ..children = [ 3353 ..children = [
3345 new PathElement() 3354 new PathElement()
3346 ..setAttribute( 3355 ..setAttribute(
3347 'd', 3356 'd',
3348 'M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 ' 3357 'M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 '
3349 '10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 ' 3358 '10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 '
3350 '0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 ' 3359 '0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 '
3351 '9h2V7h-2v2z') 3360 '9h2V7h-2v2z')
3352 ]; 3361 ];
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/css/shared.css ('k') | runtime/observatory/lib/src/elements/helpers/nav_menu.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698