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; |
11 | 11 |
12 // Information about a cacheable resource to be precached. | 12 // Information about a cacheable resource to be precached. |
13 message PrecacheResource { | 13 message PrecacheResource { |
14 // The URL of the resource. This field must always be present. | 14 // The URL of the resource. This field must always be present. |
15 optional string url = 1; | 15 optional string url = 1; |
16 | |
17 // The tophost this resource corresponds to. | |
18 optional string top_host_name = 2; | |
19 }; | |
20 | |
21 message PrecacheManifestId { | |
22 // Time at the creation of this manifest. | |
sclittle
2016/08/16 21:05:06
nit: Remove this comment - ideally, this ID should
Raj
2016/08/18 00:23:24
Yes. I missed removing it.
| |
23 optional int64 id = 1; | |
16 }; | 24 }; |
17 | 25 |
18 // A manifest of cacheable resources to be precached for a specific host. | 26 // A manifest of cacheable resources to be precached for a specific host. |
19 message PrecacheManifest { | 27 message PrecacheManifest { |
20 // List of resources that we predict that the user will need if they are | 28 // List of resources that we predict that the user will need if they are |
21 // likely to fetch the host. | 29 // likely to fetch the host. |
22 repeated PrecacheResource resource = 1; | 30 repeated PrecacheResource resource = 1; |
23 | 31 |
24 // Experiments running on this manifest. | 32 // Experiments running on this manifest. |
25 optional PrecacheExperiments experiments = 2; | 33 optional PrecacheExperiments experiments = 2; |
34 | |
35 // Identifier for the manifest sent by the server. | |
36 optional PrecacheManifestId id = 3; | |
26 }; | 37 }; |
27 | 38 |
28 message PrecacheExperiments { | 39 message PrecacheExperiments { |
29 // A mapping between experiment groups and the resources that should be | 40 // A mapping between experiment groups and the resources that should be |
30 // considered for the experiment. | 41 // considered for the experiment. |
31 map<fixed32, PrecacheResourceSelection> resources_by_experiment_group = 1; | 42 map<fixed32, PrecacheResourceSelection> resources_by_experiment_group = 1; |
32 } | 43 }; |
33 | 44 |
34 message PrecacheResourceSelection { | 45 message PrecacheResourceSelection { |
35 // Select the resources as a std::bitset over the resources listed in the | 46 // Select the resources as a std::bitset over the resources listed in the |
36 // manifest. | 47 // manifest. |
37 // | 48 // |
38 // The bitset should be loaded as: | 49 // The bitset should be loaded as: |
39 // std::bitset selection(resource_selection.bitset()); | 50 // std::bitset selection(resource_selection.bitset()); |
40 // Then manifest.resource(i) is selected for the experiment iff | 51 // Then manifest.resource(i) is selected for the experiment iff |
41 // selection.test(i). | 52 // selection.test(i). |
42 // | 53 // |
43 // A missing bitset means that the experiment applies to all the resources. | 54 // A missing bitset means that the experiment applies to all the resources. |
44 optional fixed64 bitset = 1 [default = 0xFFFFFFFFFFFFFFFF]; | 55 optional fixed64 bitset = 1 [default = 0xFFFFFFFFFFFFFFFF]; |
45 } | 56 }; |
46 | 57 |
47 message PrecacheConfigurationSettings { | 58 message PrecacheConfigurationSettings { |
48 // The maximum rank of the user's most visited hosts to consider precaching | 59 // The maximum rank of the user's most visited hosts to consider precaching |
49 // resources for, starting from 1. For example, a value of 10 means that only | 60 // resources for, starting from 1. For example, a value of 10 means that only |
50 // hosts that are in the user's top 10 most visited hosts will be considered | 61 // hosts that are in the user's top 10 most visited hosts will be considered |
51 // as starting URLs for resource precaching. This is specified by the server | 62 // as starting URLs for resource precaching. This is specified by the server |
52 // for testing purposes, so that it's easy to adjust how aggressively | 63 // for testing purposes, so that it's easy to adjust how aggressively |
53 // resources are precached. | 64 // resources are precached. |
54 // Values that are zero or lower indicate that none of the user's top sites | 65 // Values that are zero or lower indicate that none of the user's top sites |
55 // will be used for precaching. | 66 // will be used for precaching. |
(...skipping 12 matching lines...) Expand all Loading... | |
68 // resources larger than this will be cancelled. This max applies only to new | 79 // resources larger than this will be cancelled. This max applies only to new |
69 // downloads; cached resources are not capped. | 80 // downloads; cached resources are not capped. |
70 optional uint64 max_bytes_per_resource = 4 [default = 500000 /* 500 KB */]; | 81 optional uint64 max_bytes_per_resource = 4 [default = 500000 /* 500 KB */]; |
71 | 82 |
72 // The maximum number of bytes per precache run. While precaching, the total | 83 // The maximum number of bytes per precache run. While precaching, the total |
73 // number of bytes used for resources is tallied -- this includes new | 84 // number of bytes used for resources is tallied -- this includes new |
74 // downloads as well as cached resources. After this limit is reached, no | 85 // downloads as well as cached resources. After this limit is reached, no |
75 // other resources will be downloaded. | 86 // other resources will be downloaded. |
76 optional uint64 max_bytes_total = 5 [default = 10000000 /* 10 MB */]; | 87 optional uint64 max_bytes_total = 5 [default = 10000000 /* 10 MB */]; |
77 }; | 88 }; |
OLD | NEW |