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

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

Issue 1120133002: Rework error handling in the service protocol and in Observatory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 code_view_element; 5 library code_view_element;
6 6
7 import 'dart:async';
7 import 'dart:html'; 8 import 'dart:html';
8 import 'observatory_element.dart'; 9 import 'observatory_element.dart';
9 import 'package:observatory/app.dart'; 10 import 'package:observatory/app.dart';
10 import 'package:observatory/service.dart'; 11 import 'package:observatory/service.dart';
11 import 'package:observatory/cpu_profile.dart'; 12 import 'package:observatory/cpu_profile.dart';
12 import 'package:polymer/polymer.dart'; 13 import 'package:polymer/polymer.dart';
13 14
14 class DisassemblyTable extends SortedTable { 15 class DisassemblyTable extends SortedTable {
15 DisassemblyTable(columns) : super(columns); 16 DisassemblyTable(columns) : super(columns);
16 } 17 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 if (code == null) { 54 if (code == null) {
54 return; 55 return;
55 } 56 }
56 code.load().then((Code c) { 57 code.load().then((Code c) {
57 c.loadScript(); 58 c.loadScript();
58 _updateDisassembly(); 59 _updateDisassembly();
59 _updateInline(); 60 _updateInline();
60 }); 61 });
61 } 62 }
62 63
63 void refresh(var done) { 64 Future refresh() {
64 code.reload().whenComplete(done); 65 return code.reload();
65 } 66 }
66 67
67 void refreshTicks(var done) { 68 Future refreshTicks() {
68 var isolate = code.isolate; 69 var isolate = code.isolate;
69 isolate.invokeRpc('getCpuProfile', { 'tags': 'None' }) 70 return isolate.invokeRpc('getCpuProfile', { 'tags': 'None' })
70 .then((ServiceMap response) { 71 .then((ServiceMap response) {
71 var cpuProfile = new CpuProfile(); 72 var cpuProfile = new CpuProfile();
72 cpuProfile.load(isolate, response); 73 cpuProfile.load(isolate, response);
73 _updateDisassembly(); 74 _updateDisassembly();
74 _updateInline(); 75 _updateInline();
75 }).whenComplete(done); 76 });
76 } 77 }
77 78
78 String formattedAddress(CodeInstruction instruction) { 79 String formattedAddress(CodeInstruction instruction) {
79 if (instruction.address == 0) { 80 if (instruction.address == 0) {
80 return ''; 81 return '';
81 } 82 }
82 return '0x${instruction.address.toRadixString(16)}'; 83 return '0x${instruction.address.toRadixString(16)}';
83 } 84 }
84 85
85 String formattedAddressRange(CodeInlineInterval interval) { 86 String formattedAddressRange(CodeInlineInterval interval) {
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 361 }
361 362
362 void mouseOut(Event e, var detail, Node target) { 363 void mouseOut(Event e, var detail, Node target) {
363 var jt = _findJumpTarget(target); 364 var jt = _findJumpTarget(target);
364 if (jt == null) { 365 if (jt == null) {
365 return; 366 return;
366 } 367 }
367 jt.classes.remove('highlight'); 368 jt.classes.remove('highlight');
368 } 369 }
369 } 370 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698