From 1e01b775e393a7b92ac0d6e9d50b207ad6786d17 Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Thu, 27 Feb 2020 08:29:58 -0800 Subject: [PATCH] Enable HTTP and socket profiling dart:io service extensions for Flutter (#16800) --- lib/ui/dart_runtime_hooks.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ui/dart_runtime_hooks.cc b/lib/ui/dart_runtime_hooks.cc index 662d2d631108c..945833981c477 100644 --- a/lib/ui/dart_runtime_hooks.cc +++ b/lib/ui/dart_runtime_hooks.cc @@ -142,6 +142,14 @@ static void InitDartIO(Dart_Handle builtin_library, Dart_Handle result = Dart_SetField(platform_type, ToDart("_localeClosure"), locale_closure); PropagateIfError(result); + + // Register dart:io service extensions used for network profiling. + Dart_Handle network_profiling_type = + Dart_GetType(io_lib, ToDart("_NetworkProfiling"), 0, nullptr); + PropagateIfError(network_profiling_type); + result = Dart_Invoke(network_profiling_type, + ToDart("_registerServiceExtension"), 0, nullptr); + PropagateIfError(result); } void DartRuntimeHooks::Install(bool is_ui_isolate,