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

Side by Side 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 unified diff | Download patch
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 syntax = "proto2"; 5 syntax = "proto2";
6 6
7 package precache; 7 package precache;
8 8
9 // Chrome requires this. 9 // Chrome requires this.
10 option optimize_for = LITE_RUNTIME; 10 option optimize_for = LITE_RUNTIME;
(...skipping 27 matching lines...) Expand all
38 // Identifier for the manifest sent by the server. 38 // Identifier for the manifest sent by the server.
39 optional PrecacheManifestId id = 3; 39 optional PrecacheManifestId id = 3;
40 }; 40 };
41 41
42 message PrecacheExperiments { 42 message PrecacheExperiments {
43 // A mapping between experiment groups and the resources that should be 43 // A mapping between experiment groups and the resources that should be
44 // considered for the experiment. 44 // considered for the experiment.
45 map<fixed32, PrecacheResourceSelection> resources_by_experiment_group = 1; 45 map<fixed32, PrecacheResourceSelection> resources_by_experiment_group = 1;
46 }; 46 };
47 47
48 // Determines which of the resources in the manifest should be selected.
48 message PrecacheResourceSelection { 49 message PrecacheResourceSelection {
49 // Select the resources as a std::bitset over the resources listed in the 50 // A bitset over the resources listed in the manifest. Bits correspond to
50 // manifest. 51 // resource position in LSB-to-MSB order, as in:
51 // 52 //
52 // The bitset should be loaded as: 53 // if ((0x1ULL << i) && deprecated_bitset) IncludeResource(i);
53 // std::bitset selection(resource_selection.bitset());
54 // Then manifest.resource(i) is selected for the experiment iff
55 // selection.test(i).
56 // 54 //
57 // A missing bitset means that the experiment applies to all the resources. 55 // Deprecated because it only supports up to 64 resources.
58 optional fixed64 bitset = 1 [default = 0xFFFFFFFFFFFFFFFF]; 56 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.
57
58 // A bitset over the resources listed in the manifest. Bits correspond to
59 // resource position. Bytes are ordered little-endian, and bits within each
60 // byte are ordered LSB-to-MSB. The resulting bitstream is of mixed order,
61 // but easy to test:
62 //
63 // if ((1 << (i % 8)) & bitset[i / 8]) IncludeResource(i);
64 //
65 // Takes precedence over deprecated_bitset, if both are present.
66 optional bytes bitset = 2;
67
68 // A PrecacheResourceSelection without deprecated_bitset or bitset means that
69 // all resources should be selected.
59 }; 70 };
60 71
61 message PrecacheConfigurationSettings { 72 message PrecacheConfigurationSettings {
62 // The maximum rank of the user's most visited hosts to consider precaching 73 // The maximum rank of the user's most visited hosts to consider precaching
63 // resources for, starting from 1. For example, a value of 10 means that only 74 // resources for, starting from 1. For example, a value of 10 means that only
64 // hosts that are in the user's top 10 most visited hosts will be considered 75 // hosts that are in the user's top 10 most visited hosts will be considered
65 // as starting URLs for resource precaching. This is specified by the server 76 // as starting URLs for resource precaching. This is specified by the server
66 // for testing purposes, so that it's easy to adjust how aggressively 77 // for testing purposes, so that it's easy to adjust how aggressively
67 // resources are precached. 78 // resources are precached.
68 // Values that are zero or lower indicate that none of the user's top sites 79 // Values that are zero or lower indicate that none of the user's top sites
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // days, given that weight_ratio is a probability that a visit to the host 128 // days, given that weight_ratio is a probability that a visit to the host
118 // will request a resource, and host_visits is an estimate of the number of 129 // will request a resource, and host_visits is an estimate of the number of
119 // visits to the host in the next 30 days. 130 // visits to the host in the next 30 days.
120 FUNCTION_NAIVE = 0; 131 FUNCTION_NAIVE = 0;
121 // Models the probability of at least one request, given the same. 132 // Models the probability of at least one request, given the same.
122 FUNCTION_GEOMETRIC = 1; 133 FUNCTION_GEOMETRIC = 1;
123 }; 134 };
124 optional ResourceWeightFunction resource_weight_function = 11 135 optional ResourceWeightFunction resource_weight_function = 11
125 [default = FUNCTION_NAIVE]; 136 [default = FUNCTION_NAIVE];
126 }; 137 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698