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

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

Issue 2204563003: Converted Observatory cpu-profile element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Removed tmp files Created 4 years, 4 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'package:observatory/models.dart' as M; 5 import 'package:observatory/models.dart' as M;
6 6
7 /// Utility class for URIs generation. 7 /// Utility class for URIs generation.
8 abstract class Uris { 8 abstract class Uris {
9 static String _isolatePage(String path, M.IsolateRef isolate, 9 static String _isolatePage(String path, M.IsolateRef isolate,
10 {M.ObjectRef object}) { 10 {M.ObjectRef object}) {
11 final parameters = { 'isolateId': isolate.id }; 11 final parameters = { 'isolateId': isolate.id };
12 if (object != null) parameters['objectId'] = object.id; 12 if (object != null) parameters['objectId'] = object.id;
13 return '#' + new Uri(path: path, queryParameters: parameters).toString(); 13 return '#' + new Uri(path: path, queryParameters: parameters).toString();
14 } 14 }
15 15
16 static String allocationProfiler(M.IsolateRef isolate)
17 => _isolatePage('/allocation-profiler', isolate);
18 static String classTree(M.IsolateRef isolate)
19 => _isolatePage('/class-tree', isolate);
20 static String cpuProfiler(M.IsolateRef isolate)
21 => _isolatePage('/profiler', isolate);
22 static String cpuProfilerTable(M.IsolateRef isolate)
23 => _isolatePage('/profiler-table', isolate);
24 static String debugger(M.IsolateRef isolate)
25 => _isolatePage('/debugger', isolate);
26 static String flags() => '#/flags';
27 static String heapMap(M.IsolateRef isolate)
28 => _isolatePage('/heap-map', isolate);
29 static String heapSnapshot(M.IsolateRef isolate)
30 => _isolatePage('/heap-snapshot', isolate);
16 static String inspect(M.IsolateRef isolate, {M.ObjectRef object, int pos}) { 31 static String inspect(M.IsolateRef isolate, {M.ObjectRef object, int pos}) {
17 if (pos == null) { 32 if (pos == null) {
18 return _isolatePage('/inspect', isolate, object: object); 33 return _isolatePage('/inspect', isolate, object: object);
19 } 34 }
20 return _isolatePage('/inspect', isolate, object: object) + '---pos=${pos}'; 35 return _isolatePage('/inspect', isolate, object: object) + '---pos=${pos}';
21 } 36 }
22 static String debugger(M.IsolateRef isolate) 37 static String logging(M.IsolateRef isolate)
23 => _isolatePage('/debugger', isolate); 38 => _isolatePage('/logging', isolate);
24 static String classTree(M.IsolateRef isolate)
25 => _isolatePage('/class-tree', isolate);
26 static String cpuProfiler(M.IsolateRef isolate)
27 => _isolatePage('/profiler', isolate);
28 static String cpuProfilerTable(M.IsolateRef isolate)
29 => _isolatePage('/profiler-table', isolate);
30 static String allocationProfiler(M.IsolateRef isolate)
31 => _isolatePage('/allocation-profiler', isolate);
32 static String heapMap(M.IsolateRef isolate)
33 => _isolatePage('/heap-map', isolate);
34 static String metrics(M.IsolateRef isolate) 39 static String metrics(M.IsolateRef isolate)
35 => _isolatePage('/metrics', isolate); 40 => _isolatePage('/metrics', isolate);
36 static String heapSnapshot(M.IsolateRef isolate)
37 => _isolatePage('/heap-snapshot', isolate);
38 static String persistentHandles(M.IsolateRef isolate) 41 static String persistentHandles(M.IsolateRef isolate)
39 => _isolatePage('/persistent-handles', isolate); 42 => _isolatePage('/persistent-handles', isolate);
40 static String ports(M.IsolateRef isolate) 43 static String ports(M.IsolateRef isolate)
41 => _isolatePage('/ports', isolate); 44 => _isolatePage('/ports', isolate);
42 static String logging(M.IsolateRef isolate) 45 static String profiler(M.IsolateRef isolate)
43 => _isolatePage('/logging', isolate); 46 => _isolatePage('/ports', isolate);
44 static String vm() => '#/vm'; 47 static String vm() => '#/vm';
45 static String vmConnect() => '#/vm-connect'; 48 static String vmConnect() => '#/vm-connect';
46 } 49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698