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

Unified Diff: components/precache/core/proto/precache.proto

Issue 2710673004: precache: Allow experiment bitsets of any size. (Closed)
Patch Set: Created 3 years, 10 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
Index: components/precache/core/proto/precache.proto
diff --git a/components/precache/core/proto/precache.proto b/components/precache/core/proto/precache.proto
index dd80621a3b66ac57cf1fa8b1d19ecc0a77fac899..56ccb4f3fa3d6e23fa0906aa100203aa656e662b 100644
--- a/components/precache/core/proto/precache.proto
+++ b/components/precache/core/proto/precache.proto
@@ -45,17 +45,28 @@ message PrecacheExperiments {
map<fixed32, PrecacheResourceSelection> resources_by_experiment_group = 1;
};
+// Determines which of the resources in the manifest should be selected.
message PrecacheResourceSelection {
- // Select the resources as a std::bitset over the resources listed in the
- // manifest.
+ // A bitset over the resources listed in the manifest. Bits correspond to
+ // resource position in LSB-to-MSB order, as in:
//
- // The bitset should be loaded as:
- // std::bitset selection(resource_selection.bitset());
- // Then manifest.resource(i) is selected for the experiment iff
- // selection.test(i).
+ // if ((0x1ULL << i) && deprecated_bitset) IncludeResource(i);
//
- // A missing bitset means that the experiment applies to all the resources.
- optional fixed64 bitset = 1 [default = 0xFFFFFFFFFFFFFFFF];
+ // Deprecated because it only supports up to 64 resources.
+ optional fixed64 deprecated_bitset = 1 [default = 0xFFFFFFFFFFFFFFFF];
jamartin 2017/02/22 22:14:01 s/deprecated_bitset/DEPRECATED_bitset/ Maybe set
twifkak 2017/02/22 23:55:03 Done.
+
+ // A bitset over the resources listed in the manifest. Bits correspond to
+ // resource position. Bytes are ordered little-endian, and bits within each
+ // byte are ordered LSB-to-MSB. The resulting bitstream is of mixed order,
+ // but easy to test:
+ //
+ // if ((1 << (i % 8)) & bitset[i / 8]) IncludeResource(i);
+ //
+ // Takes precedence over deprecated_bitset, if both are present.
+ optional bytes bitset = 2;
+
+ // A PrecacheResourceSelection without deprecated_bitset or bitset means that
+ // all resources should be selected.
};
message PrecacheConfigurationSettings {

Powered by Google App Engine
This is Rietveld 408576698