dependency: List endpoint use new depgraph class.

Begin using the new depgraph class to get the sysroot dependencies
relevant to a given set of source paths.

BUG=chromium:1132917, chromium:1149921
TEST=./run_pytest, led job

Change-Id: Ic92a9b9d2acd056084037cfa3bca5aea0ce42c28
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2675230
Tested-by: Navil Perez <navil@google.com>
Reviewed-by: Michael Mortensen <mmortensen@google.com>
Commit-Queue: Navil Perez <navil@google.com>
diff --git a/api/controller/dependency.py b/api/controller/dependency.py
index bd2ad62..dc72374 100644
--- a/api/controller/dependency.py
+++ b/api/controller/dependency.py
@@ -111,21 +111,18 @@
     output_proto: The empty output message.
     _config: The API call config.
   """
-  build_target = controller_util.ParseBuildTarget(
-      input_proto.sysroot.build_target)
   sysroot_path = input_proto.sysroot.path
   src_paths = [src_path.path for src_path in input_proto.src_paths]
-  packages = [controller_util.PackageInfoToCPV(x) for x in input_proto.packages]
-
   package_deps = dependency.GetDependencies(
       sysroot_path,
-      build_target=build_target,
       src_paths=src_paths,
-      packages=packages)
+      packages=[
+          controller_util.deserialize_package_info(package)
+          for package in input_proto.packages
+      ])
   for package in package_deps:
     pkg_info_msg = output_proto.package_deps.add()
-    pkg_info = package_info.parse(package)
-    controller_util.serialize_package_info(pkg_info, pkg_info_msg)
+    controller_util.serialize_package_info(package, pkg_info_msg)
 
 
 def _DummyGetToolchainPathsResponse(_input_proto, output_proto, _config):