| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 assert(element != null); | 382 assert(element != null); |
| 383 assert(canVisit(uri)); | 383 assert(canVisit(uri)); |
| 384 } | 384 } |
| 385 | 385 |
| 386 bool canVisit(Uri uri) => uri.path == 'vm-connect'; | 386 bool canVisit(Uri uri) => uri.path == 'vm-connect'; |
| 387 } | 387 } |
| 388 | 388 |
| 389 class IsolateReconnectPage extends Page { | 389 class IsolateReconnectPage extends Page { |
| 390 IsolateReconnectPage(app) : super(app); | 390 IsolateReconnectPage(app) : super(app); |
| 391 | 391 |
| 392 DivElement container = new DivElement(); |
| 393 |
| 392 void onInstall() { | 394 void onInstall() { |
| 393 if (element == null) { | 395 element = container; |
| 394 element = new Element.tag('isolate-reconnect'); | |
| 395 } | |
| 396 assert(element != null); | |
| 397 } | 396 } |
| 398 | 397 |
| 399 void _visit(Uri uri) { | 398 void _visit(Uri uri) { |
| 400 app.vm.reload(); | 399 app.vm.reload(); |
| 400 container.children = [ |
| 401 new IsolateReconnectElement(app.vm, app.events, app.notifications, |
| 402 uri.queryParameters['isolateId'], |
| 403 Uri.parse(uri.queryParameters['originalUri'])) |
| 404 ]; |
| 401 assert(element != null); | 405 assert(element != null); |
| 402 assert(canVisit(uri)); | 406 assert(canVisit(uri)); |
| 403 } | 407 } |
| 404 | 408 |
| 405 bool canVisit(Uri uri) => uri.path == 'isolate-reconnect'; | 409 bool canVisit(Uri uri) => uri.path == 'isolate-reconnect'; |
| 406 } | 410 } |
| 407 | 411 |
| 408 class MetricsPage extends Page { | 412 class MetricsPage extends Page { |
| 409 // Page state, retained as long as ObservatoryApplication. | 413 // Page state, retained as long as ObservatoryApplication. |
| 410 String selectedMetricId; | 414 String selectedMetricId; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 assert(element != null); | 478 assert(element != null); |
| 475 } | 479 } |
| 476 | 480 |
| 477 void _visit(Uri uri) { | 481 void _visit(Uri uri) { |
| 478 assert(element != null); | 482 assert(element != null); |
| 479 assert(canVisit(uri)); | 483 assert(canVisit(uri)); |
| 480 } | 484 } |
| 481 | 485 |
| 482 bool canVisit(Uri uri) => uri.path == 'timeline'; | 486 bool canVisit(Uri uri) => uri.path == 'timeline'; |
| 483 } | 487 } |
| OLD | NEW |