Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: tools/android/loading/cloud/common/loading_trace_database.py

Issue 1969373002: tools/android/loading Move LoadingTraceDatabase under cloud/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@report
Patch Set: Rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 """Represents a database of on-disk traces.""" 5 """Represents a database of on-disk traces."""
6 6
7 import json 7 import json
8 8
9 9
10 class LoadingTraceDatabase(object): 10 class LoadingTraceDatabase(object):
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 @classmethod 48 @classmethod
49 def FromJsonString(cls, json_string): 49 def FromJsonString(cls, json_string):
50 """Returns an instance from a string returned by ToJsonString().""" 50 """Returns an instance from a string returned by ToJsonString()."""
51 return LoadingTraceDatabase(json.loads(json_string)) 51 return LoadingTraceDatabase(json.loads(json_string))
52 52
53 @classmethod 53 @classmethod
54 def FromJsonFile(cls, json_path): 54 def FromJsonFile(cls, json_path):
55 """Returns an instance from a json file saved by ToJsonFile().""" 55 """Returns an instance from a json file saved by ToJsonFile()."""
56 with open(json_path) as input_file: 56 with open(json_path) as input_file:
57 return cls.FromJsonDict(json.load(input_file)) 57 return cls.FromJsonDict(json.load(input_file))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698