OLD | NEW |
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 app; | 5 part of app; |
6 | 6 |
7 /// A [Page] controls the user interface of Observatory. At any given time | 7 /// A [Page] controls the user interface of Observatory. At any given time |
8 /// one page will be the current page. Pages are registered at startup. | 8 /// one page will be the current page. Pages are registered at startup. |
9 /// When the user navigates within the application, each page is asked if it | 9 /// When the user navigates within the application, each page is asked if it |
10 /// can handle the current location, the first page to say yes, wins. | 10 /// can handle the current location, the first page to say yes, wins. |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 getIsolate(uri).then((isolate) { | 197 getIsolate(uri).then((isolate) { |
198 if (element != null) { | 198 if (element != null) { |
199 /// Update the page. | 199 /// Update the page. |
200 CpuProfileElement page = element; | 200 CpuProfileElement page = element; |
201 page.isolate = isolate; | 201 page.isolate = isolate; |
202 } | 202 } |
203 }); | 203 }); |
204 } | 204 } |
205 } | 205 } |
206 | 206 |
| 207 class TableCpuProfilerPage extends SimplePage { |
| 208 TableCpuProfilerPage(app) |
| 209 : super('profiler-table', 'cpu-profile-table', app); |
| 210 |
| 211 void _visit(Uri uri) { |
| 212 super._visit(uri); |
| 213 getIsolate(uri).then((isolate) { |
| 214 if (element != null) { |
| 215 /// Update the page. |
| 216 CpuProfileTableElement page = element; |
| 217 page.isolate = isolate; |
| 218 page.checkParameters(); |
| 219 } |
| 220 }); |
| 221 } |
| 222 } |
| 223 |
207 class AllocationProfilerPage extends SimplePage { | 224 class AllocationProfilerPage extends SimplePage { |
208 AllocationProfilerPage(app) | 225 AllocationProfilerPage(app) |
209 : super('allocation-profiler', 'heap-profile', app); | 226 : super('allocation-profiler', 'heap-profile', app); |
210 | 227 |
211 void _visit(Uri uri) { | 228 void _visit(Uri uri) { |
212 super._visit(uri); | 229 super._visit(uri); |
213 getIsolate(uri).then((isolate) { | 230 getIsolate(uri).then((isolate) { |
214 if (element != null) { | 231 if (element != null) { |
215 /// Update the page. | 232 /// Update the page. |
216 HeapProfileElement page = element; | 233 HeapProfileElement page = element; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 void _visit(Uri uri) { | 342 void _visit(Uri uri) { |
326 assert(element != null); | 343 assert(element != null); |
327 assert(canVisit(uri)); | 344 assert(canVisit(uri)); |
328 app.vm.getIsolate(uri.queryParameters['isolateId']).then((i) { | 345 app.vm.getIsolate(uri.queryParameters['isolateId']).then((i) { |
329 (element as MetricsPageElement).isolate = i; | 346 (element as MetricsPageElement).isolate = i; |
330 }); | 347 }); |
331 } | 348 } |
332 | 349 |
333 bool canVisit(Uri uri) => uri.path == 'metrics'; | 350 bool canVisit(Uri uri) => uri.path == 'metrics'; |
334 } | 351 } |
OLD | NEW |