| 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 AllocationProfileRepository _allocationProfileRepository | 7 AllocationProfileRepository _allocationProfileRepository |
| 8 = new AllocationProfileRepository(); | 8 = new AllocationProfileRepository(); |
| 9 InstanceRepository _instanceRepository = new InstanceRepository(); |
| 9 IsolateSampleProfileRepository _isolateSampleProfileRepository | 10 IsolateSampleProfileRepository _isolateSampleProfileRepository |
| 10 = new IsolateSampleProfileRepository(); | 11 = new IsolateSampleProfileRepository(); |
| 12 PortsRepository _portsRepository = new PortsRepository(); |
| 11 | 13 |
| 12 class IsolateNotFound implements Exception { | 14 class IsolateNotFound implements Exception { |
| 13 String isolateId; | 15 String isolateId; |
| 14 IsolateNotFound(this.isolateId); | 16 IsolateNotFound(this.isolateId); |
| 15 String toString() => "IsolateNotFound: $isolateId"; | 17 String toString() => "IsolateNotFound: $isolateId"; |
| 16 } | 18 } |
| 17 | 19 |
| 18 /// A [Page] controls the user interface of Observatory. At any given time | 20 /// A [Page] controls the user interface of Observatory. At any given time |
| 19 /// one page will be the current page. Pages are registered at startup. | 21 /// one page will be the current page. Pages are registered at startup. |
| 20 /// When the user navigates within the application, each page is asked if it | 22 /// When the user navigates within the application, each page is asked if it |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } | 296 } |
| 295 app.startGCEventListener(); | 297 app.startGCEventListener(); |
| 296 } | 298 } |
| 297 | 299 |
| 298 void onUninstall() { | 300 void onUninstall() { |
| 299 super.onUninstall(); | 301 super.onUninstall(); |
| 300 app.stopGCEventListener(); | 302 app.stopGCEventListener(); |
| 301 } | 303 } |
| 302 } | 304 } |
| 303 | 305 |
| 304 class PortsPage extends SimplePage { | 306 class PortsPage extends MatchingPage { |
| 305 PortsPage(app) | 307 PortsPage(app) : super('ports', app); |
| 306 : super('ports', 'ports-page', app); | 308 |
| 309 DivElement container = new DivElement(); |
| 307 | 310 |
| 308 void _visit(Uri uri) { | 311 void _visit(Uri uri) { |
| 309 super._visit(uri); | 312 super._visit(uri); |
| 310 getIsolate(uri).then((isolate) { | 313 getIsolate(uri).then((isolate) { |
| 311 if (element != null) { | 314 container.children = [ |
| 312 PortsPageElement page = element; | 315 new PortsElement(isolate.vm, isolate, app.events, app.notifications, |
| 313 page.isolate = isolate; | 316 _portsRepository, _instanceRepository, |
| 314 } | 317 queue: app.queue) |
| 318 ]; |
| 315 }); | 319 }); |
| 316 } | 320 } |
| 321 |
| 322 void onInstall() { |
| 323 if (element == null) { |
| 324 element = container; |
| 325 } |
| 326 } |
| 317 } | 327 } |
| 318 | 328 |
| 319 class PersistentHandlesPage extends SimplePage { | 329 class PersistentHandlesPage extends SimplePage { |
| 320 PersistentHandlesPage(app) | 330 PersistentHandlesPage(app) |
| 321 : super('persistent-handles', 'persistent-handles-page', app); | 331 : super('persistent-handles', 'persistent-handles-page', app); |
| 322 | 332 |
| 323 void _visit(Uri uri) { | 333 void _visit(Uri uri) { |
| 324 super._visit(uri); | 334 super._visit(uri); |
| 325 getIsolate(uri).then((isolate) { | 335 getIsolate(uri).then((isolate) { |
| 326 if (element != null) { | 336 if (element != null) { |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 assert(element != null); | 521 assert(element != null); |
| 512 } | 522 } |
| 513 | 523 |
| 514 void _visit(Uri uri) { | 524 void _visit(Uri uri) { |
| 515 assert(element != null); | 525 assert(element != null); |
| 516 assert(canVisit(uri)); | 526 assert(canVisit(uri)); |
| 517 } | 527 } |
| 518 | 528 |
| 519 bool canVisit(Uri uri) => uri.path == 'timeline'; | 529 bool canVisit(Uri uri) => uri.path == 'timeline'; |
| 520 } | 530 } |
| OLD | NEW |