Commit bba1dd31 authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

Pack policy::PolicyDetails slightly more.

A cheap way of saving a kilobyte of binary size by simply making some
fields narrower. This decreases the size of this from 20 bytes to
12 bytes per entry. 8 bytes could be done with some more intrusive
repacking, but there are diminishing returns.

Change-Id: If89d2025b6b374766d602cd7caafac5e675d4c7c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2243252
Commit-Queue: Owen Min <zmin@chromium.org>
Auto-Submit: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: default avatarOwen Min <zmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805383}
parent 18c4ffcb
...@@ -18,13 +18,13 @@ namespace policy { ...@@ -18,13 +18,13 @@ namespace policy {
// Contains read-only metadata about a Chrome policy. // Contains read-only metadata about a Chrome policy.
struct POLICY_EXPORT PolicyDetails { struct POLICY_EXPORT PolicyDetails {
// True if this policy has been deprecated. // True if this policy has been deprecated.
bool is_deprecated; bool is_deprecated : 1;
// True if the policy hasn't been released yet. // True if the policy hasn't been released yet.
bool is_future; bool is_future : 1;
// True if this policy is a Chrome OS device policy. // True if this policy is a Chrome OS device policy.
bool is_device_policy; bool is_device_policy : 1;
// The id of the protobuf field that contains this policy, // The id of the protobuf field that contains this policy,
// in the cloud policy protobuf. // in the cloud policy protobuf.
......
...@@ -1283,7 +1283,7 @@ class RiskTags(object): ...@@ -1283,7 +1283,7 @@ class RiskTags(object):
values = [' ' + self.enum_for_tag[tag] for tag in self.enum_for_tag] values = [' ' + self.enum_for_tag[tag] for tag in self.enum_for_tag]
values.append(' RISK_TAG_COUNT') values.append(' RISK_TAG_COUNT')
values.append(' RISK_TAG_NONE') values.append(' RISK_TAG_NONE')
enum_text = 'enum RiskTag {\n' enum_text = 'enum RiskTag : uint8_t {\n'
enum_text += ',\n'.join(values) + '\n};\n' enum_text += ',\n'.join(values) + '\n};\n'
return enum_text return enum_text
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment