| OLD | NEW |
| 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 Loading... |
| 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 |
| 57 [default = 0xFFFFFFFFFFFFFFFF, deprecated = true]; |
| 58 |
| 59 // A bitset over the resources listed in the manifest. Bits correspond to |
| 60 // resource position. Bytes are ordered little-endian, and bits within each |
| 61 // byte are ordered LSB-to-MSB. The resulting bitstream is of mixed order, |
| 62 // but easy to test: |
| 63 // |
| 64 // if ((1 << (i % 8)) & bitset[i / 8]) IncludeResource(i); |
| 65 // |
| 66 // Takes precedence over DEPRECATED_bitset, if both are present. |
| 67 optional bytes bitset = 2; |
| 68 |
| 69 // A PrecacheResourceSelection without DEPRECATED_bitset or bitset means that |
| 70 // all resources should be selected. |
| 59 }; | 71 }; |
| 60 | 72 |
| 61 message PrecacheConfigurationSettings { | 73 message PrecacheConfigurationSettings { |
| 62 // The maximum rank of the user's most visited hosts to consider precaching | 74 // 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 | 75 // 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 | 76 // 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 | 77 // 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 | 78 // for testing purposes, so that it's easy to adjust how aggressively |
| 67 // resources are precached. | 79 // resources are precached. |
| 68 // Values that are zero or lower indicate that none of the user's top sites | 80 // 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 Loading... |
| 117 // days, given that weight_ratio is a probability that a visit to the host | 129 // 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 | 130 // will request a resource, and host_visits is an estimate of the number of |
| 119 // visits to the host in the next 30 days. | 131 // visits to the host in the next 30 days. |
| 120 FUNCTION_NAIVE = 0; | 132 FUNCTION_NAIVE = 0; |
| 121 // Models the probability of at least one request, given the same. | 133 // Models the probability of at least one request, given the same. |
| 122 FUNCTION_GEOMETRIC = 1; | 134 FUNCTION_GEOMETRIC = 1; |
| 123 }; | 135 }; |
| 124 optional ResourceWeightFunction resource_weight_function = 11 | 136 optional ResourceWeightFunction resource_weight_function = 11 |
| 125 [default = FUNCTION_NAIVE]; | 137 [default = FUNCTION_NAIVE]; |
| 126 }; | 138 }; |
| OLD | NEW |