Unverified Commit eb7a59b6 authored by Stanislav Baranov's avatar Stanislav Baranov Committed by GitHub

Switch over to the new name for compilation trace native function (#25594)

* Switch over to the new name for compilation trace native function.

Also see: https://github.com/flutter/engine/pull/7256

* rename

* roll the engine
parent b6248e26
dbdb5e6f8c9fc8add75d7b5a19bdaa1144a9332e e859296b71def257f021ff8bd225e82209558cea
...@@ -6,7 +6,7 @@ import 'dart:async'; ...@@ -6,7 +6,7 @@ import 'dart:async';
import 'dart:convert' show json; import 'dart:convert' show json;
import 'dart:developer' as developer; import 'dart:developer' as developer;
import 'dart:io' show exit; import 'dart:io' show exit;
import 'dart:ui' show dumpCompilationTrace; import 'dart:ui' show saveCompilationTrace;
import 'package:meta/meta.dart'; import 'package:meta/meta.dart';
...@@ -119,10 +119,10 @@ abstract class BindingBase { ...@@ -119,10 +119,10 @@ abstract class BindingBase {
callback: _exitApplication, callback: _exitApplication,
); );
registerServiceExtension( registerServiceExtension(
name: 'dumpCompilationTrace', name: 'saveCompilationTrace',
callback: (Map<String, String> parameters) async { callback: (Map<String, String> parameters) async {
return <String, dynamic> { return <String, dynamic> {
'value': dumpCompilationTrace(), 'value': saveCompilationTrace(),
}; };
} }
); );
......
...@@ -527,9 +527,9 @@ void main() { ...@@ -527,9 +527,9 @@ void main() {
expect(binding.frameScheduled, isFalse); expect(binding.frameScheduled, isFalse);
}); });
test('Service extensions - dumpCompilationTrace', () async { test('Service extensions - saveCompilationTrace', () async {
Map<String, dynamic> result; Map<String, dynamic> result;
result = await binding.testExtension('dumpCompilationTrace', <String, String>{}); result = await binding.testExtension('saveCompilationTrace', <String, String>{});
final String trace = String.fromCharCodes(result['value']); final String trace = String.fromCharCodes(result['value']);
expect(trace, contains('dart:core,Object,Object.\n')); expect(trace, contains('dart:core,Object,Object.\n'));
expect(trace, contains('package:test_api/test_api.dart,::,test\n')); expect(trace, contains('package:test_api/test_api.dart,::,test\n'));
......
...@@ -490,7 +490,7 @@ abstract class ResidentRunner { ...@@ -490,7 +490,7 @@ abstract class ResidentRunner {
Future<void> stop() async { Future<void> stop() async {
_stopped = true; _stopped = true;
if (saveCompilationTrace) if (saveCompilationTrace)
await _saveCompilationTrace(); await _debugSaveCompilationTrace();
await stopEchoingDeviceLog(); await stopEchoingDeviceLog();
await preStop(); await preStop();
return stopApp(); return stopApp();
...@@ -595,7 +595,7 @@ abstract class ResidentRunner { ...@@ -595,7 +595,7 @@ abstract class ResidentRunner {
} }
} }
Future<void> _saveCompilationTrace() async { Future<void> _debugSaveCompilationTrace() async {
if (!supportsServiceProtocol) if (!supportsServiceProtocol)
return; return;
...@@ -607,7 +607,7 @@ abstract class ResidentRunner { ...@@ -607,7 +607,7 @@ abstract class ResidentRunner {
List<int> buffer; List<int> buffer;
try { try {
buffer = await view.uiIsolate.flutterDumpCompilationTrace(); buffer = await view.uiIsolate.flutterDebugSaveCompilationTrace();
assert(buffer != null); assert(buffer != null);
} catch (error) { } catch (error) {
printError('Error communicating with Flutter on the device: $error'); printError('Error communicating with Flutter on the device: $error');
......
...@@ -1312,9 +1312,9 @@ class Isolate extends ServiceObjectOwner { ...@@ -1312,9 +1312,9 @@ class Isolate extends ServiceObjectOwner {
); );
} }
Future<List<int>> flutterDumpCompilationTrace() async { Future<List<int>> flutterDebugSaveCompilationTrace() async {
final Map<String, dynamic> result = final Map<String, dynamic> result =
await invokeFlutterExtensionRpcRaw('ext.flutter.dumpCompilationTrace'); await invokeFlutterExtensionRpcRaw('ext.flutter.saveCompilationTrace');
if (result != null && result['value'] is List<dynamic>) if (result != null && result['value'] is List<dynamic>)
return result['value'].cast<int>(); return result['value'].cast<int>();
return null; return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment