Chromium Code Reviews| Index: tools/android/loading/processing.py |
| diff --git a/tools/android/loading/processing.py b/tools/android/loading/processing.py |
| index 1f4893915840286f2e262b96dd6d64754275df0c..7c009516ce13513c07310651d4b72cffc353112f 100644 |
| --- a/tools/android/loading/processing.py |
| +++ b/tools/android/loading/processing.py |
| @@ -2,12 +2,13 @@ |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| +import json |
| import os |
| import os.path |
| import sys |
| -import log_parser |
| import loading_model |
| +import loading_trace |
| def SitesFromDir(directory): |
| @@ -52,8 +53,9 @@ def WarmGraph(datadir, site): |
| Returns: |
| A loading model object. |
| """ |
| - return loading_model.ResourceGraph(log_parser.FilterRequests( |
| - log_parser.ParseJsonFile(os.path.join(datadir, site + '.json')))) |
| + with file(os.path.join(datadir, site + '.json')) as f: |
| + return loading_model.ResourceGraph(loading_trace.LoadingTrace.FromJsonDict( |
| + json.load(f))) |
| def ColdGraph(datadir, site): |
| @@ -68,5 +70,6 @@ def ColdGraph(datadir, site): |
| Returns: |
| A loading model object. |
| """ |
| - return loading_model.ResourceGraph(log_parser.FilterRequests( |
| - log_parser.ParseJsonFile(os.path.join(datadir, site + '.json.cold')))) |
| + with file(os.path.join(datadir, site + '.json.cold')) as f: |
| + return loading_model.ResourceGraph(loading_trace.LoadingTrace.FromJsonDict( |
|
blundell
2016/01/21 14:11:38
given the number of times that you're doing this,
mattcary
2016/01/21 16:11:35
I am going to have ResourceGraph take a json dict
|
| + json.load(f))) |