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

Side by Side Diff: runtime/bin/vmservice/client/lib/src/observatory/isolate.dart

Issue 135843006: Improve Code object support in service and observatory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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 part of observatory; 5 part of observatory;
6 6
7 /// State for a running isolate. 7 /// State for a running isolate.
8 class Isolate extends Observable { 8 class Isolate extends Observable {
9 @observable dprof.Isolate profiler; 9 @observable Profile profile;
10 @observable final List<Code> codes = new List<Code>();
10 @observable String id; 11 @observable String id;
11 @observable String name; 12 @observable String name;
12 @observable final Map<String, ScriptSource> scripts = 13 @observable final Map<String, ScriptSource> scripts =
13 toObservable(new Map<String, ScriptSource>()); 14 toObservable(new Map<String, ScriptSource>());
14 15
15 Isolate(this.id, this.name); 16 Isolate(this.id, this.name);
16 17
17 String toString() => '$id $name'; 18 String toString() => '$id $name';
18 } 19
20 Code findCodeByAddress(int address) {
21 for (var i = 0; i < codes.length; i++) {
22 if (codes[i].contains(address)) {
23 return codes[i];
24 }
25 }
26 }
27
28 Code findCodeByName(String name) {
29 for (var i = 0; i < codes.length; i++) {
30 if (codes[i].name == name) {
31 return codes[i];
32 }
33 }
34 }
35
36 void resetCodeTicks() {
37 Logger.root.info('Reset all code ticks.');
38 for (var i = 0; i < codes.length; i++) {
39 codes[i].resetTicks();
40 }
41 }
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698