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 class IsolateNotFound implements Exception { | 7 class IsolateNotFound implements Exception { |
8 String isolateId; | 8 String isolateId; |
9 IsolateNotFound(this.isolateId); | 9 IsolateNotFound(this.isolateId); |
10 String toString() => "IsolateNotFound: $isolateId"; | 10 String toString() => "IsolateNotFound: $isolateId"; |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 getIsolate(uri).then((isolate) { | 287 getIsolate(uri).then((isolate) { |
288 if (element != null) { | 288 if (element != null) { |
289 /// Update the page. | 289 /// Update the page. |
290 HeapSnapshotElement page = element; | 290 HeapSnapshotElement page = element; |
291 page.isolate = isolate; | 291 page.isolate = isolate; |
292 } | 292 } |
293 }); | 293 }); |
294 } | 294 } |
295 } | 295 } |
296 | 296 |
| 297 |
| 298 class LoggingPage extends SimplePage { |
| 299 LoggingPage(app) : super('logging', 'logging-page', app); |
| 300 |
| 301 void _visit(Uri uri) { |
| 302 super._visit(uri); |
| 303 getIsolate(uri).then((isolate) { |
| 304 if (element != null) { |
| 305 /// Update the page. |
| 306 LoggingPageElement page = element; |
| 307 page.isolate = isolate; |
| 308 } |
| 309 }); |
| 310 } |
| 311 } |
| 312 |
297 class ErrorViewPage extends Page { | 313 class ErrorViewPage extends Page { |
298 ErrorViewPage(app) : super(app); | 314 ErrorViewPage(app) : super(app); |
299 | 315 |
300 void onInstall() { | 316 void onInstall() { |
301 if (element == null) { | 317 if (element == null) { |
302 /// Lazily create page. | 318 /// Lazily create page. |
303 element = new Element.tag('service-view'); | 319 element = new Element.tag('service-view'); |
304 } | 320 } |
305 } | 321 } |
306 | 322 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 void _visit(Uri uri) { | 418 void _visit(Uri uri) { |
403 assert(element != null); | 419 assert(element != null); |
404 assert(canVisit(uri)); | 420 assert(canVisit(uri)); |
405 app.vm.getIsolate(uri.queryParameters['isolateId']).then((i) { | 421 app.vm.getIsolate(uri.queryParameters['isolateId']).then((i) { |
406 (element as MetricsPageElement).isolate = i; | 422 (element as MetricsPageElement).isolate = i; |
407 }); | 423 }); |
408 } | 424 } |
409 | 425 |
410 bool canVisit(Uri uri) => uri.path == 'metrics'; | 426 bool canVisit(Uri uri) => uri.path == 'metrics'; |
411 } | 427 } |
OLD | NEW |