Index: tools/telemetry/telemetry/core/chrome/adb_commands.py |
diff --git a/tools/telemetry/telemetry/core/chrome/adb_commands.py b/tools/telemetry/telemetry/core/chrome/adb_commands.py |
index e18e667d35717f5dc74cd69fd0437758c1b1d269..890327bf19eb273a4c97d9f590b86ae327c0907f 100644 |
--- a/tools/telemetry/telemetry/core/chrome/adb_commands.py |
+++ b/tools/telemetry/telemetry/core/chrome/adb_commands.py |
@@ -20,7 +20,6 @@ try: |
from pylib import cmd_helper # pylint: disable=F0401 |
from pylib import forwarder # pylint: disable=F0401 |
from pylib import ports # pylint: disable=F0401 |
- from pylib import valgrind_tools # pylint: disable=F0401 |
except Exception: |
android_commands = None |
@@ -160,34 +159,24 @@ def HasForwarder(buildtype=None): |
class Forwarder(object): |
def __init__(self, adb, *port_pairs): |
- tool = valgrind_tools.BaseTool() |
+ self._adb = adb.Adb() |
self._host_port = port_pairs[0].local_port |
new_port_pairs = [(port_pair.local_port, port_pair.remote_port) |
for port_pair in port_pairs] |
- self._forwarder = forwarder.Forwarder(adb.Adb(), Forwarder._GetBuildType()) |
- self._forwarder.Run(new_port_pairs, tool) |
+ self._port_pairs = new_port_pairs |
+ forwarder.Forwarder.Map(new_port_pairs, self._adb) |
@staticmethod |
def _GetBuildType(): |
assert HasForwarder() |
return 'Debug' if HasForwarder('Debug') else 'Release' |
- @staticmethod |
- def KillHost(): |
- forwarder.Forwarder.KillHost(Forwarder._GetBuildType()) |
- |
- @staticmethod |
- def KillDevice(adb): |
- forwarder.Forwarder.KillDevice(adb.Adb(), valgrind_tools.BaseTool()) |
- |
@property |
def url(self): |
- assert self._forwarder |
return 'http://localhost:%i' % self._host_port |
def Close(self): |
- if self._forwarder: |
- self._forwarder.Close() |
- self._forwarder = None |
+ for (device_port, _) in self._port_pairs: |
+ forwarder.Forwarder.UnmapDevicePort(device_port, self._adb) |