| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 | 4 |
| 5 import os | 5 import os |
| 6 import json | 6 import json |
| 7 | 7 |
| 8 from chrome_profiler import chrome_controller | 8 from chrome_profiler import chrome_controller |
| 9 from chrome_profiler import controllers_unittest | 9 from chrome_profiler import controllers_unittest |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 controller.StartTracing(interval) | 37 controller.StartTracing(interval) |
| 38 finally: | 38 finally: |
| 39 controller.StopTracing() | 39 controller.StopTracing() |
| 40 | 40 |
| 41 result = controller.PullTrace() | 41 result = controller.PullTrace() |
| 42 try: | 42 try: |
| 43 with open(result) as f: | 43 with open(result) as f: |
| 44 json.loads(f.read()) | 44 json.loads(f.read()) |
| 45 finally: | 45 finally: |
| 46 os.remove(result) | 46 os.remove(result) |
| OLD | NEW |