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

Side by Side Diff: sdk/lib/developer/profiler.dart

Issue 1971193002: Patches to support Dart VM patch files in dart2js. (Closed) Base URL: sso://user/ahe/dart-sdk@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « sdk/lib/developer/extension.dart ('k') | sdk/lib/internal/internal.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 part of dart.developer; 5 part of dart.developer;
6 6
7 /// A UserTag can be used to group samples in the Observatory profiler. 7 /// A UserTag can be used to group samples in the Observatory profiler.
8 abstract class UserTag { 8 abstract class UserTag {
9 /// The maximum number of UserTag instances that can be created by a program. 9 /// The maximum number of UserTag instances that can be created by a program.
10 static const MAX_USER_TAGS = 64; 10 static const MAX_USER_TAGS = 64;
11 11
12 factory UserTag(String label) => new _FakeUserTag(label); 12 external factory UserTag(String label);
13 13
14 /// Label of [this]. 14 /// Label of [this].
15 String get label; 15 String get label;
16 16
17 /// Make [this] the current tag for the isolate. Returns the current tag 17 /// Make [this] the current tag for the isolate. Returns the current tag
18 /// before setting. 18 /// before setting.
19 UserTag makeCurrent(); 19 UserTag makeCurrent();
20 20
21 /// The default [UserTag] with label 'Default'. 21 /// The default [UserTag] with label 'Default'.
22 static UserTag get defaultTag => _FakeUserTag._defaultTag; 22 external static UserTag get defaultTag;
23 } 23 }
24 24
25 // This is a fake implementation of UserTag so that code can compile and run 25 // This is a fake implementation of UserTag so that code can compile and run
26 // in dart2js. 26 // in dart2js.
27 class _FakeUserTag implements UserTag { 27 class _FakeUserTag implements UserTag {
28 static Map _instances = {}; 28 static Map _instances = {};
29 29
30 _FakeUserTag.real(this.label); 30 _FakeUserTag.real(this.label);
31 31
32 factory _FakeUserTag(String label) { 32 factory _FakeUserTag(String label) {
(...skipping 20 matching lines...) Expand all
53 _currentTag = this; 53 _currentTag = this;
54 return old; 54 return old;
55 } 55 }
56 56
57 static final UserTag _defaultTag = new _FakeUserTag('Default'); 57 static final UserTag _defaultTag = new _FakeUserTag('Default');
58 } 58 }
59 59
60 var _currentTag = _FakeUserTag._defaultTag; 60 var _currentTag = _FakeUserTag._defaultTag;
61 61
62 /// Returns the current [UserTag] for the isolate. 62 /// Returns the current [UserTag] for the isolate.
63 UserTag getCurrentTag() { 63 external UserTag getCurrentTag();
64 return _currentTag;
65 }
66 64
67 /// Abstract [Metric] class. Metric names must be unique, are hierarchical, 65 /// Abstract [Metric] class. Metric names must be unique, are hierarchical,
68 /// and use periods as separators. For example, 'a.b.c'. Uniqueness is only 66 /// and use periods as separators. For example, 'a.b.c'. Uniqueness is only
69 /// enforced when a Metric is registered. The name of a metric cannot contain 67 /// enforced when a Metric is registered. The name of a metric cannot contain
70 /// the slash ('/') character. 68 /// the slash ('/') character.
71 abstract class Metric { 69 abstract class Metric {
72 /// [name] of this metric. 70 /// [name] of this metric.
73 final String name; 71 final String name;
74 /// [description] of this metric. 72 /// [description] of this metric.
75 final String description; 73 final String description;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 for (var metric in _metrics.values) { 186 for (var metric in _metrics.values) {
189 metrics.add(metric._toJSON()); 187 metrics.add(metric._toJSON());
190 } 188 }
191 var map = { 189 var map = {
192 'type': 'MetricList', 190 'type': 'MetricList',
193 'metrics': metrics, 191 'metrics': metrics,
194 }; 192 };
195 return JSON.encode(map); 193 return JSON.encode(map);
196 } 194 }
197 } 195 }
OLDNEW
« no previous file with comments | « sdk/lib/developer/extension.dart ('k') | sdk/lib/internal/internal.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698