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

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

Issue 2255613002: Converted Observatory heap-profile element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Better sorting tests 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 AllocationProfileRepository _allocationProfileRepository
8 = new AllocationProfileRepository();
7 IsolateSampleProfileRepository _isolateSampleProfileRepository 9 IsolateSampleProfileRepository _isolateSampleProfileRepository
8 = new IsolateSampleProfileRepository(); 10 = new IsolateSampleProfileRepository();
9 11
10 class IsolateNotFound implements Exception { 12 class IsolateNotFound implements Exception {
11 String isolateId; 13 String isolateId;
12 IsolateNotFound(this.isolateId); 14 IsolateNotFound(this.isolateId);
13 String toString() => "IsolateNotFound: $isolateId"; 15 String toString() => "IsolateNotFound: $isolateId";
14 } 16 }
15 17
16 /// A [Page] controls the user interface of Observatory. At any given time 18 /// A [Page] controls the user interface of Observatory. At any given time
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 // TODO(johnmccutchan): Provide a more general mechanism to notify 264 // TODO(johnmccutchan): Provide a more general mechanism to notify
263 // elements of URI parameter changes. Possibly via a stream off of 265 // elements of URI parameter changes. Possibly via a stream off of
264 // LocationManager. With a stream individual elements (not just pages) 266 // LocationManager. With a stream individual elements (not just pages)
265 // could be notified. 267 // could be notified.
266 page.checkParameters(); 268 page.checkParameters();
267 } 269 }
268 }); 270 });
269 } 271 }
270 } 272 }
271 273
272 class AllocationProfilerPage extends SimplePage { 274 class AllocationProfilerPage extends MatchingPage {
273 AllocationProfilerPage(app) 275 AllocationProfilerPage(app) : super('allocation-profiler', app);
274 : super('allocation-profiler', 'heap-profile', app); 276
277 DivElement container = new DivElement();
275 278
276 void _visit(Uri uri) { 279 void _visit(Uri uri) {
277 super._visit(uri); 280 super._visit(uri);
278 getIsolate(uri).then((isolate) { 281 getIsolate(uri).then((isolate) {
279 if (element != null) { 282 container.children = [
280 /// Update the page. 283 new AllocationProfileElement(isolate.vm, isolate, app.events,
281 HeapProfileElement page = element; 284 app.notifications,
282 page.isolate = isolate; 285 _allocationProfileRepository,
283 } 286 queue: app.queue)
287 ];
284 }); 288 });
285 } 289 }
290
291 void onInstall() {
292 if (element == null) {
293 element = container;
294 }
295 app.startGCEventListener();
296 }
297
298 void onUninstall() {
299 super.onUninstall();
300 app.stopGCEventListener();
301 }
286 } 302 }
287 303
288 class PortsPage extends SimplePage { 304 class PortsPage extends SimplePage {
289 PortsPage(app) 305 PortsPage(app)
290 : super('ports', 'ports-page', app); 306 : super('ports', 'ports-page', app);
291 307
292 void _visit(Uri uri) { 308 void _visit(Uri uri) {
293 super._visit(uri); 309 super._visit(uri);
294 getIsolate(uri).then((isolate) { 310 getIsolate(uri).then((isolate) {
295 if (element != null) { 311 if (element != null) {
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 assert(element != null); 511 assert(element != null);
496 } 512 }
497 513
498 void _visit(Uri uri) { 514 void _visit(Uri uri) {
499 assert(element != null); 515 assert(element != null);
500 assert(canVisit(uri)); 516 assert(canVisit(uri));
501 } 517 }
502 518
503 bool canVisit(Uri uri) => uri.path == 'timeline'; 519 bool canVisit(Uri uri) => uri.path == 'timeline';
504 } 520 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/app/application.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