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

Side by Side Diff: mojo/public/tools/bindings/pylib/generate/mojom_pack.py

Issue 226263002: Mojo: Move mojo/public/bindings to mojo/public/tools/bindings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 mojom 5 import mojom
6 6
7 # mojom_pack provides a mechanism for determining the packed order and offsets 7 # mojom_pack provides a mechanism for determining the packed order and offsets
8 # of a mojom.Struct. 8 # of a mojom.Struct.
9 # 9 #
10 # ps = mojom_pack.PackedStruct(struct) 10 # ps = mojom_pack.PackedStruct(struct)
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 limit_of_previous_field = packed_field.offset + packed_field.size 140 limit_of_previous_field = packed_field.offset + packed_field.size
141 141
142 for i in xrange(limit_of_previous_field, len(bytes)): 142 for i in xrange(limit_of_previous_field, len(bytes)):
143 bytes[i].is_padding = True 143 bytes[i].is_padding = True
144 144
145 for byte in bytes: 145 for byte in bytes:
146 # A given byte cannot both be padding and have a fields packed into it. 146 # A given byte cannot both be padding and have a fields packed into it.
147 assert not (byte.is_padding and byte.packed_fields) 147 assert not (byte.is_padding and byte.packed_fields)
148 148
149 return bytes 149 return bytes
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698