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

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

Issue 2266343002: Converted Observatory heap-snapshot element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Removed debug code 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 HeapSnapshotRepository _heapSnapshotRepository
10 = new HeapSnapshotRepository();
9 InstanceRepository _instanceRepository = new InstanceRepository(); 11 InstanceRepository _instanceRepository = new InstanceRepository();
10 IsolateSampleProfileRepository _isolateSampleProfileRepository 12 IsolateSampleProfileRepository _isolateSampleProfileRepository
11 = new IsolateSampleProfileRepository(); 13 = new IsolateSampleProfileRepository();
12 PortsRepository _portsRepository = new PortsRepository(); 14 PortsRepository _portsRepository = new PortsRepository();
13 15
14 class IsolateNotFound implements Exception { 16 class IsolateNotFound implements Exception {
15 String isolateId; 17 String isolateId;
16 IsolateNotFound(this.isolateId); 18 IsolateNotFound(this.isolateId);
17 String toString() => "IsolateNotFound: $isolateId"; 19 String toString() => "IsolateNotFound: $isolateId";
18 } 20 }
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 getIsolate(uri).then((isolate) { 351 getIsolate(uri).then((isolate) {
350 if (element != null) { 352 if (element != null) {
351 /// Update the page. 353 /// Update the page.
352 HeapMapElement page = element; 354 HeapMapElement page = element;
353 page.isolate = isolate; 355 page.isolate = isolate;
354 } 356 }
355 }); 357 });
356 } 358 }
357 } 359 }
358 360
359 class HeapSnapshotPage extends SimplePage { 361 class HeapSnapshotPage extends MatchingPage {
360 HeapSnapshotPage(app) : super('heap-snapshot', 'heap-snapshot', app); 362 HeapSnapshotPage(app) : super('heap-snapshot', app);
363
364 DivElement container = new DivElement();
361 365
362 void _visit(Uri uri) { 366 void _visit(Uri uri) {
363 super._visit(uri); 367 super._visit(uri);
364 getIsolate(uri).then((isolate) { 368 getIsolate(uri).then((isolate) {
365 if (element != null) { 369 container.children = [
366 /// Update the page. 370 new HeapSnapshotElement(isolate.vm, isolate, app.events,
367 HeapSnapshotElement page = element; 371 app.notifications, _heapSnapshotRepository,
368 page.isolate = isolate; 372 _instanceRepository, queue: app.queue)
369 } 373 ];
370 }); 374 });
371 } 375 }
376
377 void onInstall() {
378 if (element == null) {
379 element = container;
380 }
381 }
372 } 382 }
373 383
374 384
375 class LoggingPage extends SimplePage { 385 class LoggingPage extends SimplePage {
376 LoggingPage(app) : super('logging', 'logging-page', app); 386 LoggingPage(app) : super('logging', 'logging-page', app);
377 387
378 void _visit(Uri uri) { 388 void _visit(Uri uri) {
379 super._visit(uri); 389 super._visit(uri);
380 getIsolate(uri).then((isolate) { 390 getIsolate(uri).then((isolate) {
381 if (element != null) { 391 if (element != null) {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 assert(element != null); 531 assert(element != null);
522 } 532 }
523 533
524 void _visit(Uri uri) { 534 void _visit(Uri uri) {
525 assert(element != null); 535 assert(element != null);
526 assert(canVisit(uri)); 536 assert(canVisit(uri));
527 } 537 }
528 538
529 bool canVisit(Uri uri) => uri.path == 'timeline'; 539 bool canVisit(Uri uri) => uri.path == 'timeline';
530 } 540 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/service.dart ('k') | runtime/observatory/lib/src/elements/class_view.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698