Chromium Code Reviews| Index: tools/android/adb_profile_chrome/chrome_controller.py |
| diff --git a/tools/android/adb_profile_chrome/chrome_controller.py b/tools/android/adb_profile_chrome/chrome_controller.py |
| index 5457e93dace8315abfc977f59d6fec43fa9988a2..cf4c14788670e7b81bd71e73365f176c39416af9 100644 |
| --- a/tools/android/adb_profile_chrome/chrome_controller.py |
| +++ b/tools/android/adb_profile_chrome/chrome_controller.py |
| @@ -10,6 +10,7 @@ import time |
| from adb_profile_chrome import controllers |
| from pylib import pexpect |
| +from pylib.device import intent |
| _HEAP_PROFILE_MMAP_PROPERTY = 'heapprof.mmap' |
| @@ -35,8 +36,8 @@ class ChromeTracingController(controllers.BaseController): |
| @staticmethod |
| def GetCategories(device, package_info): |
| - device.old_interface.BroadcastIntent( |
| - package_info.package, 'GPU_PROFILER_LIST_CATEGORIES') |
| + device.BroadcastIntent(intent.Intent( |
| + action='%s.GPU_PROFILER_LIST_CATEGORIES' % self._package_info.package)) |
| try: |
| json_category_list = device.old_interface.WaitForLogMatch( |
| re.compile(r'{"traceCategoriesList(.*)'), None, timeout=5).group(0) |
| @@ -58,10 +59,12 @@ class ChromeTracingController(controllers.BaseController): |
| def StartTracing(self, interval): |
| self._trace_interval = interval |
| self._device.old_interface.SyncLogCat() |
| - self._device.old_interface.BroadcastIntent( |
| - self._package_info.package, 'GPU_PROFILER_START', |
| - '-e categories "%s"' % ','.join(self._categories), |
| - '-e continuous' if self._ring_buffer else '') |
| + self._device.BroadcastIntent(intent.Intent( |
| + action='%s.GPU_PROFILER_START' % self._package_info.package, |
| + extras={ |
| + 'categories': ','.join(self._categories), |
| + 'continuous' if self._ring_buffer else '': None |
|
Victor Starodub
2014/06/17 18:43:42
This one looks a bit ugly. It's not exactly equiv
Sami
2014/06/17 20:39:11
+1. It might be better to construct the Intent fir
jbudorick
2014/06/17 21:09:27
I'll at least move the creation of the extras dict
|
| + })) |
| if self._trace_memory: |
| self._device.old_interface.EnableAdbRoot() |
| @@ -83,9 +86,8 @@ class ChromeTracingController(controllers.BaseController): |
| 'of the browser running?') |
| def StopTracing(self): |
| - self._device.old_interface.BroadcastIntent( |
| - self._package_info.package, |
| - 'GPU_PROFILER_STOP') |
| + self._device.BroadcastIntent(intent.Intent( |
| + action='%s.GPU_PROFILER_STOP' % self._package_info.package)) |
| self._trace_file = self._device.old_interface.WaitForLogMatch( |
| self._trace_finish_re, None, timeout=120).group(1) |
| if self._trace_memory: |