| OLD | NEW |
| 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 library heap_map_element; | 5 library heap_map_element; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'dart:math'; | 9 import 'dart:math'; |
| 10 import 'observatory_element.dart'; | 10 import 'observatory_element.dart'; |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 new Future(() { | 217 new Future(() { |
| 218 _renderPages(startPage + 1); | 218 _renderPages(startPage + 1); |
| 219 }); | 219 }); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void isolateChanged(oldValue) { | 222 void isolateChanged(oldValue) { |
| 223 if (isolate == null) { | 223 if (isolate == null) { |
| 224 fragmentation = null; | 224 fragmentation = null; |
| 225 return; | 225 return; |
| 226 } | 226 } |
| 227 isolate.invokeRpc('getHeapMap', {}).then((ServiceMap response) { | 227 isolate.invokeRpc('_getHeapMap', {}).then((ServiceMap response) { |
| 228 assert(response['type'] == 'HeapMap'); | 228 assert(response['type'] == 'HeapMap'); |
| 229 fragmentation = response; | 229 fragmentation = response; |
| 230 }).catchError((e, st) { | 230 }).catchError((e, st) { |
| 231 Logger.root.info('$e $st'); | 231 Logger.root.info('$e $st'); |
| 232 }); | 232 }); |
| 233 } | 233 } |
| 234 | 234 |
| 235 Future refresh() { | 235 Future refresh() { |
| 236 if (isolate == null) { | 236 if (isolate == null) { |
| 237 return new Future.value(null); | 237 return new Future.value(null); |
| 238 } | 238 } |
| 239 return isolate.invokeRpc('getHeapMap', {}).then((ServiceMap response) { | 239 return isolate.invokeRpc('_getHeapMap', {}).then((ServiceMap response) { |
| 240 assert(response['type'] == 'HeapMap'); | 240 assert(response['type'] == 'HeapMap'); |
| 241 fragmentation = response; | 241 fragmentation = response; |
| 242 }); | 242 }); |
| 243 } | 243 } |
| 244 | 244 |
| 245 void fragmentationChanged(oldValue) { | 245 void fragmentationChanged(oldValue) { |
| 246 // Async, in case attached has not yet run (observed in JS version). | 246 // Async, in case attached has not yet run (observed in JS version). |
| 247 new Future(() { | 247 new Future(() { |
| 248 _updateFragmentationData(); | 248 _updateFragmentationData(); |
| 249 }); | 249 }); |
| 250 } | 250 } |
| 251 } | 251 } |
| OLD | NEW |