diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h index 422e2be38e3..02c28b243dd 100644 --- a/runtime/include/dart_api.h +++ b/runtime/include/dart_api.h @@ -3449,17 +3449,6 @@ DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_LoadLibraryFromKernel(const uint8_t* kernel_buffer, intptr_t kernel_buffer_size); -/** - * Returns a flattened list of pairs. The first element in each pair is the - * importing library and and the second element is the imported library for each - * import in the isolate of a library whose URI's scheme is [scheme]. - * - * Requires there to be a current isolate. - * - * \return A handle to a list of flattened pairs of importer-importee. - */ -DART_EXPORT Dart_Handle Dart_GetImportsOfScheme(Dart_Handle scheme); - /** * Indicates that all outstanding load requests have been satisfied. * This finalizes all the new classes loaded and optionally completes diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc index 5d21abf7c44..94c0f77ca3c 100644 --- a/runtime/vm/dart_api_impl.cc +++ b/runtime/vm/dart_api_impl.cc @@ -5802,41 +5802,6 @@ DART_EXPORT Dart_Handle Dart_LoadLibraryFromKernel(const uint8_t* buffer, #endif // defined(DART_PRECOMPILED_RUNTIME) } -DART_EXPORT Dart_Handle Dart_GetImportsOfScheme(Dart_Handle scheme) { - DARTSCOPE(Thread::Current()); - auto IG = T->isolate_group(); - const String& scheme_vm = Api::UnwrapStringHandle(Z, scheme); - if (scheme_vm.IsNull()) { - RETURN_TYPE_ERROR(Z, scheme, String); - } - - const GrowableObjectArray& libraries = - GrowableObjectArray::Handle(Z, IG->object_store()->libraries()); - const GrowableObjectArray& result = - GrowableObjectArray::Handle(Z, GrowableObjectArray::New()); - Library& importer = Library::Handle(Z); - Array& imports = Array::Handle(Z); - Namespace& ns = Namespace::Handle(Z); - Library& importee = Library::Handle(Z); - String& importee_uri = String::Handle(Z); - for (intptr_t i = 0; i < libraries.Length(); i++) { - importer ^= libraries.At(i); - imports = importer.imports(); - for (intptr_t j = 0; j < imports.Length(); j++) { - ns ^= imports.At(j); - if (ns.IsNull()) continue; - importee = ns.target(); - importee_uri = importee.url(); - if (importee_uri.StartsWith(scheme_vm)) { - result.Add(importer); - result.Add(importee); - } - } - } - - return Api::NewHandle(T, Array::MakeFixedLength(result)); -} - // Finalizes classes and invokes Dart core library function that completes // futures of loadLibrary calls (deferred library loading). DART_EXPORT Dart_Handle Dart_FinalizeLoading(bool complete_futures) {