| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 getIsolate(uri).then((isolate) { | 257 getIsolate(uri).then((isolate) { |
| 258 if (element != null) { | 258 if (element != null) { |
| 259 /// Update the page. | 259 /// Update the page. |
| 260 HeapMapElement page = element; | 260 HeapMapElement page = element; |
| 261 page.isolate = isolate; | 261 page.isolate = isolate; |
| 262 } | 262 } |
| 263 }); | 263 }); |
| 264 } | 264 } |
| 265 } | 265 } |
| 266 | 266 |
| 267 class HeapSnapshotPage extends SimplePage { |
| 268 HeapSnapshotPage(app) : super('heap-snapshot', 'heap-snapshot', app); |
| 269 |
| 270 void _visit(Uri uri) { |
| 271 super._visit(uri); |
| 272 getIsolate(uri).then((isolate) { |
| 273 if (element != null) { |
| 274 /// Update the page. |
| 275 HeapSnapshotElement page = element; |
| 276 page.isolate = isolate; |
| 277 } |
| 278 }); |
| 279 } |
| 280 } |
| 281 |
| 267 class ErrorViewPage extends Page { | 282 class ErrorViewPage extends Page { |
| 268 ErrorViewPage(app) : super(app); | 283 ErrorViewPage(app) : super(app); |
| 269 | 284 |
| 270 void onInstall() { | 285 void onInstall() { |
| 271 if (element == null) { | 286 if (element == null) { |
| 272 /// Lazily create page. | 287 /// Lazily create page. |
| 273 element = new Element.tag('service-view'); | 288 element = new Element.tag('service-view'); |
| 274 } | 289 } |
| 275 } | 290 } |
| 276 | 291 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 void _visit(Uri uri) { | 387 void _visit(Uri uri) { |
| 373 assert(element != null); | 388 assert(element != null); |
| 374 assert(canVisit(uri)); | 389 assert(canVisit(uri)); |
| 375 app.vm.getIsolate(uri.queryParameters['isolateId']).then((i) { | 390 app.vm.getIsolate(uri.queryParameters['isolateId']).then((i) { |
| 376 (element as MetricsPageElement).isolate = i; | 391 (element as MetricsPageElement).isolate = i; |
| 377 }); | 392 }); |
| 378 } | 393 } |
| 379 | 394 |
| 380 bool canVisit(Uri uri) => uri.path == 'metrics'; | 395 bool canVisit(Uri uri) => uri.path == 'metrics'; |
| 381 } | 396 } |
| OLD | NEW |