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

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: Optimizations & Dead code removal 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 _heapProfileRepository
Cutch 2016/08/17 14:28:44 _allocationProfileRepository
cbernaschina 2016/08/17 17:01:27 Done.
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, _heapProfileRepository,
282 page.isolate = isolate; 285 queue: app.queue)
283 } 286 ];
284 }); 287 });
285 } 288 }
289
290 void onInstall() {
291 if (element == null) {
292 element = container;
293 }
294 app.startGCEventListener();
295 }
296
297 void onUninstall() {
298 super.onUninstall();
299 app.stopGCEventListener();
300 }
286 } 301 }
287 302
288 class PortsPage extends SimplePage { 303 class PortsPage extends SimplePage {
289 PortsPage(app) 304 PortsPage(app)
290 : super('ports', 'ports-page', app); 305 : super('ports', 'ports-page', app);
291 306
292 void _visit(Uri uri) { 307 void _visit(Uri uri) {
293 super._visit(uri); 308 super._visit(uri);
294 getIsolate(uri).then((isolate) { 309 getIsolate(uri).then((isolate) {
295 if (element != null) { 310 if (element != null) {
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 assert(element != null); 510 assert(element != null);
496 } 511 }
497 512
498 void _visit(Uri uri) { 513 void _visit(Uri uri) {
499 assert(element != null); 514 assert(element != null);
500 assert(canVisit(uri)); 515 assert(canVisit(uri));
501 } 516 }
502 517
503 bool canVisit(Uri uri) => uri.path == 'timeline'; 518 bool canVisit(Uri uri) => uri.path == 'timeline';
504 } 519 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698