| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 """Brings in Chrome Android's android_commands module, which itself is a | 4 """Brings in Chrome Android's android_commands module, which itself is a |
| 5 thin(ish) wrapper around adb.""" | 5 thin(ish) wrapper around adb.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import shutil | 9 import shutil |
| 10 import stat | 10 import stat |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 has_prebuilt = abi and abi[0].startswith('armeabi') | 181 has_prebuilt = abi and abi[0].startswith('armeabi') |
| 182 if not has_prebuilt: | 182 if not has_prebuilt: |
| 183 logging.error('Prebuilt tools only available for ARM.') | 183 logging.error('Prebuilt tools only available for ARM.') |
| 184 return False | 184 return False |
| 185 | 185 |
| 186 prebuilt_tools = [ | 186 prebuilt_tools = [ |
| 187 'forwarder_dist/device_forwarder', | 187 'forwarder_dist/device_forwarder', |
| 188 'host_forwarder', | 188 'host_forwarder', |
| 189 'md5sum_dist/md5sum_bin', | 189 'md5sum_dist/md5sum_bin', |
| 190 'md5sum_bin_host', | 190 'md5sum_bin_host', |
| 191 'purge_ashmem', |
| 191 ] | 192 ] |
| 192 for t in prebuilt_tools: | 193 for t in prebuilt_tools: |
| 193 src = os.path.basename(t) | 194 src = os.path.basename(t) |
| 194 android_prebuilt_profiler_helper.GetIfChanged(src) | 195 android_prebuilt_profiler_helper.GetIfChanged(src) |
| 195 dest = os.path.join(constants.GetOutDirectory(), t) | 196 dest = os.path.join(constants.GetOutDirectory(), t) |
| 196 if not os.path.exists(dest): | 197 if not os.path.exists(dest): |
| 197 logging.warning('Setting up prebuilt %s', dest) | 198 logging.warning('Setting up prebuilt %s', dest) |
| 198 if not os.path.exists(os.path.dirname(dest)): | 199 if not os.path.exists(os.path.dirname(dest)): |
| 199 os.makedirs(os.path.dirname(dest)) | 200 os.makedirs(os.path.dirname(dest)) |
| 200 shutil.copyfile(android_prebuilt_profiler_helper.GetHostPath(src), dest) | 201 shutil.copyfile(android_prebuilt_profiler_helper.GetHostPath(src), dest) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 230 raise Exception('Build forwarder2') | 231 raise Exception('Build forwarder2') |
| 231 forwarder.Forwarder.Map(new_port_pairs, self._adb) | 232 forwarder.Forwarder.Map(new_port_pairs, self._adb) |
| 232 | 233 |
| 233 @property | 234 @property |
| 234 def url(self): | 235 def url(self): |
| 235 return 'http://127.0.0.1:%i' % self._host_port | 236 return 'http://127.0.0.1:%i' % self._host_port |
| 236 | 237 |
| 237 def Close(self): | 238 def Close(self): |
| 238 for (device_port, _) in self._port_pairs: | 239 for (device_port, _) in self._port_pairs: |
| 239 forwarder.Forwarder.UnmapDevicePort(device_port, self._adb) | 240 forwarder.Forwarder.UnmapDevicePort(device_port, self._adb) |
| OLD | NEW |