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

Unified Diff: tools/binary_size/file_format.py

Issue 2801663003: //tools/binary_size: Add Disassemble() to console.py. Tweak metadata. (Closed)
Patch Set: Review comments Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/binary_size/describe.py ('k') | tools/binary_size/integration_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/binary_size/file_format.py
diff --git a/tools/binary_size/file_format.py b/tools/binary_size/file_format.py
index 2f66395ebdfacc4ebe4188a805291f4a1fcff23c..54503eceedebc2e1cac0831c78890fba4799e4fd 100644
--- a/tools/binary_size/file_format.py
+++ b/tools/binary_size/file_format.py
@@ -32,11 +32,9 @@ def _SaveSizeInfoToFile(size_info, file_obj):
file_obj.write('# Created by //tools/binary_size\n')
file_obj.write('%s\n' % _SERIALIZATION_VERSION)
headers = {
- 'tag': size_info.tag,
+ 'metadata': size_info.metadata,
'section_sizes': size_info.section_sizes,
}
- if size_info.timestamp:
- headers['timestamp'] = calendar.timegm(size_info.timestamp.timetuple())
metadata_str = json.dumps(headers, file_obj, indent=2, sort_keys=True)
file_obj.write('%d\n' % len(metadata_str))
file_obj.write(metadata_str)
@@ -99,13 +97,9 @@ def _LoadSizeInfoFromFile(file_obj):
'Version mismatch. Need to write some upgrade code.')
json_len = int(next(lines))
json_str = file_obj.read(json_len)
- metadata = json.loads(json_str)
- timestamp = metadata.get('timestamp')
- if timestamp is not None:
- timestamp = datetime.datetime.utcfromtimestamp(timestamp)
- tag = metadata['tag']
- section_sizes = metadata['section_sizes']
-
+ headers = json.loads(json_str)
+ section_sizes = headers['section_sizes']
+ metadata = headers['metadata']
lines = iter(file_obj)
next(lines) # newline after closing } of json.
@@ -156,7 +150,7 @@ def _LoadSizeInfoFromFile(file_obj):
symbol_idx += 1
symbols = models.SymbolGroup(symbol_list)
- return models.SizeInfo(section_sizes, symbols, timestamp=timestamp, tag=tag)
+ return models.SizeInfo(section_sizes, symbols, metadata=metadata)
def SaveSizeInfo(size_info, path):
« no previous file with comments | « tools/binary_size/describe.py ('k') | tools/binary_size/integration_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698