Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Side by Side Diff: runtime/observatory/lib/src/app/page.dart

Issue 2202973002: Converted Observatory isolate-reconnect element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 assert(canVisit(uri)); 385 assert(canVisit(uri));
386 } 386 }
387 387
388 bool canVisit(Uri uri) => uri.path == 'vm-connect'; 388 bool canVisit(Uri uri) => uri.path == 'vm-connect';
389 } 389 }
390 390
391 class IsolateReconnectPage extends Page { 391 class IsolateReconnectPage extends Page {
392 IsolateReconnectPage(app) : super(app); 392 IsolateReconnectPage(app) : super(app);
393 393
394 void onInstall() { 394 void onInstall() {
395 if (element == null) { 395 element = new IsolateReconnectElement(app.vm, app.vm.changes.map((_) {
396 element = new Element.tag('isolate-reconnect'); 396 new VMUpdateEventMock(vm: app.vm);
397 } 397 }), app.notifications);
398 assert(element != null);
399 } 398 }
400 399
401 void _visit(Uri uri) { 400 void _visit(Uri uri) {
402 app.vm.reload(); 401 app.vm.reload();
402 (element as IsolateReconnectElement)
403 ..missing = uri.queryParameters['isolateId']
404 ..uri = Uri.parse(uri.queryParameters['originalUri']);
403 assert(element != null); 405 assert(element != null);
404 assert(canVisit(uri)); 406 assert(canVisit(uri));
405 } 407 }
406 408
407 bool canVisit(Uri uri) => uri.path == 'isolate-reconnect'; 409 bool canVisit(Uri uri) => uri.path == 'isolate-reconnect';
408 } 410 }
409 411
410 class MetricsPage extends Page { 412 class MetricsPage extends Page {
411 // Page state, retained as long as ObservatoryApplication. 413 // Page state, retained as long as ObservatoryApplication.
412 String selectedMetricId; 414 String selectedMetricId;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 assert(element != null); 478 assert(element != null);
477 } 479 }
478 480
479 void _visit(Uri uri) { 481 void _visit(Uri uri) {
480 assert(element != null); 482 assert(element != null);
481 assert(canVisit(uri)); 483 assert(canVisit(uri));
482 } 484 }
483 485
484 bool canVisit(Uri uri) => uri.path == 'timeline'; 486 bool canVisit(Uri uri) => uri.path == 'timeline';
485 } 487 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698