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

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

Issue 2273203004: Converted Observatory persistent-hangles-page element (Closed)
Patch Set: Addressed comments and fixed style Created 4 years, 3 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 AllocationProfileRepository _allocationProfileRepository 7 AllocationProfileRepository _allocationProfileRepository
8 = new AllocationProfileRepository(); 8 = new AllocationProfileRepository();
9 ContextRepository _contextRepository = new ContextRepository(); 9 ContextRepository _contextRepository = new ContextRepository();
10 HeapSnapshotRepository _heapSnapshotRepository 10 HeapSnapshotRepository _heapSnapshotRepository
11 = new HeapSnapshotRepository(); 11 = new HeapSnapshotRepository();
12 ICDataRepository _icdataRepository = new ICDataRepository(); 12 ICDataRepository _icdataRepository = new ICDataRepository();
13 InboundReferencesRepository _inboundReferencesRepository 13 InboundReferencesRepository _inboundReferencesRepository
14 = new InboundReferencesRepository(); 14 = new InboundReferencesRepository();
15 InstanceRepository _instanceRepository = new InstanceRepository(); 15 InstanceRepository _instanceRepository = new InstanceRepository();
16 IsolateSampleProfileRepository _isolateSampleProfileRepository 16 IsolateSampleProfileRepository _isolateSampleProfileRepository
17 = new IsolateSampleProfileRepository(); 17 = new IsolateSampleProfileRepository();
18 PersistentHandlesRepository _persistentHandlesRepository
19 = new PersistentHandlesRepository();
18 PortsRepository _portsRepository = new PortsRepository(); 20 PortsRepository _portsRepository = new PortsRepository();
19 21
20 class IsolateNotFound implements Exception { 22 class IsolateNotFound implements Exception {
21 String isolateId; 23 String isolateId;
22 IsolateNotFound(this.isolateId); 24 IsolateNotFound(this.isolateId);
23 String toString() => "IsolateNotFound: $isolateId"; 25 String toString() => "IsolateNotFound: $isolateId";
24 } 26 }
25 RetainedSizeRepository _retainedSizeRepository = new RetainedSizeRepository(); 27 RetainedSizeRepository _retainedSizeRepository = new RetainedSizeRepository();
26 ReachableSizeRepository _reachableSizeRepository 28 ReachableSizeRepository _reachableSizeRepository
27 = new ReachableSizeRepository(); 29 = new ReachableSizeRepository();
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 }); 369 });
368 } 370 }
369 371
370 void onInstall() { 372 void onInstall() {
371 if (element == null) { 373 if (element == null) {
372 element = container; 374 element = container;
373 } 375 }
374 } 376 }
375 } 377 }
376 378
377 class PersistentHandlesPage extends SimplePage { 379 class PersistentHandlesPage extends MatchingPage {
378 PersistentHandlesPage(app) 380 PersistentHandlesPage(app) : super('persistent-handles', app);
379 : super('persistent-handles', 'persistent-handles-page', app); 381
382 final DivElement container = new DivElement();
380 383
381 void _visit(Uri uri) { 384 void _visit(Uri uri) {
382 super._visit(uri); 385 super._visit(uri);
383 getIsolate(uri).then((isolate) { 386 getIsolate(uri).then((isolate) {
384 if (element != null) { 387 container.children = [
385 PersistentHandlesPageElement page = element; 388 new PersistentHandlesPageElement(isolate.vm, isolate, app.events,
386 page.isolate = isolate; 389 app.notifications,
387 } 390 _persistentHandlesRepository,
391 _instanceRepository, queue: app.queue)
392 ];
388 }); 393 });
389 } 394 }
395
396 void onInstall() {
397 if (element == null) {
398 element = container;
399 }
400 }
390 } 401 }
391 402
392 class HeapMapPage extends SimplePage { 403 class HeapMapPage extends SimplePage {
393 HeapMapPage(app) : super('heap-map', 'heap-map', app); 404 HeapMapPage(app) : super('heap-map', 'heap-map', app);
394 405
395 void _visit(Uri uri) { 406 void _visit(Uri uri) {
396 super._visit(uri); 407 super._visit(uri);
397 getIsolate(uri).then((isolate) { 408 getIsolate(uri).then((isolate) {
398 if (element != null) { 409 if (element != null) {
399 /// Update the page. 410 /// Update the page.
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 assert(element != null); 588 assert(element != null);
578 } 589 }
579 590
580 void _visit(Uri uri) { 591 void _visit(Uri uri) {
581 assert(element != null); 592 assert(element != null);
582 assert(canVisit(uri)); 593 assert(canVisit(uri));
583 } 594 }
584 595
585 bool canVisit(Uri uri) => uri.path == 'timeline'; 596 bool canVisit(Uri uri) => uri.path == 'timeline';
586 } 597 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/repositories.dart ('k') | runtime/observatory/lib/src/elements/allocation_profile.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698