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

Side by Side Diff: runtime/observatory/lib/src/elements/native_memory_profiler.dart

Issue 2914283002: Observatory: (Closed)
Patch Set: Created 3 years, 6 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library native_memory_profile; 5 library native_memory_profile;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'package:observatory/models.dart' as M; 9 import 'package:observatory/models.dart' as M;
10 import 'package:observatory/src/elements/cpu_profile/virtual_tree.dart'; 10 import 'package:observatory/src/elements/cpu_profile/virtual_tree.dart';
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 Stream<M.SampleProfileLoadingProgressEvent> _progressStream; 45 Stream<M.SampleProfileLoadingProgressEvent> _progressStream;
46 M.SampleProfileLoadingProgress _progress; 46 M.SampleProfileLoadingProgress _progress;
47 M.SampleProfileTag _tag = M.SampleProfileTag.none; 47 M.SampleProfileTag _tag = M.SampleProfileTag.none;
48 ProfileTreeMode _mode = ProfileTreeMode.function; 48 ProfileTreeMode _mode = ProfileTreeMode.function;
49 M.ProfileTreeDirection _direction = M.ProfileTreeDirection.exclusive; 49 M.ProfileTreeDirection _direction = M.ProfileTreeDirection.exclusive;
50 String _filter = ''; 50 String _filter = '';
51 51
52 M.NotificationRepository get notifications => _notifications; 52 M.NotificationRepository get notifications => _notifications;
53 M.NativeMemorySampleProfileRepository get profiles => _profiles; 53 M.NativeMemorySampleProfileRepository get profiles => _profiles;
54 // With non-isolate version. 54 // With non-isolate version.
55 M.VMRef get vm => _vm; 55 M.VM get vm => _vm;
devoncarew 2017/06/01 21:12:20 Is this overriding something, or providing access
rmacnak 2017/06/01 21:25:56 I don't see other users, so removed. We can always
56 56
57 factory NativeMemoryProfileElement( 57 factory NativeMemoryProfileElement(
58 M.VM vm, 58 M.VM vm,
59 M.EventRepository events, 59 M.EventRepository events,
60 M.NotificationRepository notifications, 60 M.NotificationRepository notifications,
61 M.NativeMemorySampleProfileRepository profiles, 61 M.NativeMemorySampleProfileRepository profiles,
62 {RenderingQueue queue}) { 62 {RenderingQueue queue}) {
63 assert(vm != null); 63 assert(vm != null);
64 assert(events != null); 64 assert(events != null);
65 assert(notifications != null); 65 assert(notifications != null);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 }), 136 }),
137 new BRElement(), 137 new BRElement(),
138 tree = new CpuProfileVirtualTreeElement(_vm, _progress.profile, 138 tree = new CpuProfileVirtualTreeElement(_vm, _progress.profile,
139 queue: _r.queue, type: M.SampleProfileType.memory) 139 queue: _r.queue, type: M.SampleProfileType.memory)
140 ]); 140 ]);
141 } 141 }
142 children = content; 142 children = content;
143 } 143 }
144 144
145 Future _request({bool forceFetch: false}) async { 145 Future _request({bool forceFetch: false}) async {
146 for (Isolate isolate in vm.isolates) { 146 for (M.Isolate isolate in vm.isolates) {
147 await isolate.invokeRpc("_collectAllGarbage", {}); 147 await isolate.collectAllGarbage();
148 } 148 }
149 _progress = null; 149 _progress = null;
150 _progressStream = _profiles.get(_vm, _tag, forceFetch: forceFetch); 150 _progressStream = _profiles.get(_vm, _tag, forceFetch: forceFetch);
151 _r.dirty(); 151 _r.dirty();
152 _progress = (await _progressStream.first).progress; 152 _progress = (await _progressStream.first).progress;
153 _r.dirty(); 153 _r.dirty();
154 if (M.isSampleProcessRunning(_progress.status)) { 154 if (M.isSampleProcessRunning(_progress.status)) {
155 _progress = (await _progressStream.last).progress; 155 _progress = (await _progressStream.last).progress;
156 _r.dirty(); 156 _r.dirty();
157 } 157 }
158 } 158 }
159 159
160 Future _refresh(e) async { 160 Future _refresh(e) async {
161 e.element.disabled = true; 161 e.element.disabled = true;
162 await _request(forceFetch: true); 162 await _request(forceFetch: true);
163 e.element.disabled = false; 163 e.element.disabled = false;
164 } 164 }
165 } 165 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/heap_map.dart ('k') | runtime/observatory/lib/src/models/objects/isolate.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698