| OLD | NEW |
| 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 code_view_element; | 5 library code_view_element; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'package:observatory/cpu_profile.dart'; | 9 import 'package:observatory/sample_profile.dart'; |
| 10 import 'package:observatory/service.dart' as S; | 10 import 'package:observatory/service.dart' as S; |
| 11 import 'package:observatory/models.dart' as M; | 11 import 'package:observatory/models.dart' as M; |
| 12 import 'package:observatory/app.dart' | 12 import 'package:observatory/app.dart' |
| 13 show SortedTable, SortedTableColumn, SortedTableRow; | 13 show SortedTable, SortedTableColumn, SortedTableRow; |
| 14 import 'package:observatory/src/elements/curly_block.dart'; | 14 import 'package:observatory/src/elements/curly_block.dart'; |
| 15 import 'package:observatory/src/elements/function_ref.dart'; | 15 import 'package:observatory/src/elements/function_ref.dart'; |
| 16 import 'package:observatory/src/elements/helpers/any_ref.dart'; | 16 import 'package:observatory/src/elements/helpers/any_ref.dart'; |
| 17 import 'package:observatory/src/elements/helpers/nav_bar.dart'; | 17 import 'package:observatory/src/elements/helpers/nav_bar.dart'; |
| 18 import 'package:observatory/src/elements/helpers/nav_menu.dart'; | 18 import 'package:observatory/src/elements/helpers/nav_menu.dart'; |
| 19 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 19 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 S.Code code = _code as S.Code; | 340 S.Code code = _code as S.Code; |
| 341 await code.reload(); | 341 await code.reload(); |
| 342 _r.dirty(); | 342 _r.dirty(); |
| 343 } | 343 } |
| 344 | 344 |
| 345 Future _refreshTicks() async { | 345 Future _refreshTicks() async { |
| 346 S.Code code = _code as S.Code; | 346 S.Code code = _code as S.Code; |
| 347 final isolate = code.isolate; | 347 final isolate = code.isolate; |
| 348 S.ServiceMap response = | 348 S.ServiceMap response = |
| 349 await isolate.invokeRpc('_getCpuProfile', {'tags': 'None'}); | 349 await isolate.invokeRpc('_getCpuProfile', {'tags': 'None'}); |
| 350 final cpuProfile = new CpuProfile(); | 350 final cpuProfile = new SampleProfile(); |
| 351 await cpuProfile.load(isolate, response); | 351 await cpuProfile.load(isolate, response); |
| 352 _r.dirty(); | 352 _r.dirty(); |
| 353 } | 353 } |
| 354 | 354 |
| 355 String _formattedAddress(S.CodeInstruction instruction) { | 355 String _formattedAddress(S.CodeInstruction instruction) { |
| 356 if (instruction.address == 0) { | 356 if (instruction.address == 0) { |
| 357 return ''; | 357 return ''; |
| 358 } | 358 } |
| 359 return '0x${instruction.address.toRadixString(16)}'; | 359 return '0x${instruction.address.toRadixString(16)}'; |
| 360 } | 360 } |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 case M.CodeKind.stub: | 638 case M.CodeKind.stub: |
| 639 return 'stub'; | 639 return 'stub'; |
| 640 case M.CodeKind.tag: | 640 case M.CodeKind.tag: |
| 641 return 'tag'; | 641 return 'tag'; |
| 642 case M.CodeKind.collected: | 642 case M.CodeKind.collected: |
| 643 return 'collected'; | 643 return 'collected'; |
| 644 } | 644 } |
| 645 throw new Exception('Unknown CodeKind ($kind)'); | 645 throw new Exception('Unknown CodeKind ($kind)'); |
| 646 } | 646 } |
| 647 } | 647 } |
| OLD | NEW |