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 | 16 |
17 // The tophost this resource corresponds to. | 17 // The tophost this resource corresponds to. |
18 optional string top_host_name = 2; | 18 optional string top_host_name = 2; |
19 | 19 |
20 // How important this resource is for the host. It ranges from 0.0 to 1.0. | 20 // How important this resource is for the host. It ranges from 0.0 to 1.0. |
21 // Higher values mean more important. | 21 // Higher values mean more important. |
22 optional double weight_ratio = 3; | 22 optional double weight_ratio = 3; |
23 | 23 |
24 // How important this resource is for the client; a combination of | 24 // How important this resource is for the client; a combination of |
25 // weight_ratio and TopHost.visits. Populated only in PrecacheUnfinishedWork. | 25 // weight_ratio and TopHost.visits. Populated only in PrecacheUnfinishedWork. |
26 // This is a non-negative number, with higher being more important. Its value | 26 // This is a non-negative number, with higher being more important. Its value |
27 // depends on PrecacheConfigurationSettings.resource_weight_function. | 27 // depends on PrecacheConfigurationSettings.resource_weight_function. |
28 optional double weight = 4; | 28 optional double weight = 4; |
29 | |
30 enum Type { | |
31 RESOURCE_TYPE_UNKNOWN = 0; | |
32 | |
33 RESOURCE_TYPE_IMAGE = 1; | |
34 RESOURCE_TYPE_FONT = 2; | |
35 RESOURCE_TYPE_STYLESHEET = 3; | |
36 RESOURCE_TYPE_SCRIPT = 4; | |
37 | |
38 RESOURCE_TYPE_OTHER = 7; | |
39 } | |
40 | |
41 // The type of resource. | |
42 optional Type type = 5; | |
Benoit L
2017/04/27 08:54:15
Does the precache code need to be updated in any w
alexilin
2017/04/27 15:32:23
I don't think so. This field was in real manifests
| |
29 }; | 43 }; |
30 | 44 |
31 message PrecacheManifestId { | 45 message PrecacheManifestId { |
32 optional int64 id = 1; | 46 optional int64 id = 1; |
33 }; | 47 }; |
34 | 48 |
35 // A manifest of cacheable resources to be precached for a specific host. | 49 // A manifest of cacheable resources to be precached for a specific host. |
36 // CAUTION: When any change is done here, bump kDatabaseVersion in | 50 // CAUTION: When any change is done here, bump kDatabaseVersion in |
37 // chrome/browser/predictors/resource_prefetch_predictor_tables.h | 51 // chrome/browser/predictors/resource_prefetch_predictor_tables.h |
38 message PrecacheManifest { | 52 message PrecacheManifest { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 // days, given that weight_ratio is a probability that a visit to the host | 151 // days, given that weight_ratio is a probability that a visit to the host |
138 // will request a resource, and host_visits is an estimate of the number of | 152 // will request a resource, and host_visits is an estimate of the number of |
139 // visits to the host in the next 30 days. | 153 // visits to the host in the next 30 days. |
140 FUNCTION_NAIVE = 0; | 154 FUNCTION_NAIVE = 0; |
141 // Models the probability of at least one request, given the same. | 155 // Models the probability of at least one request, given the same. |
142 FUNCTION_GEOMETRIC = 1; | 156 FUNCTION_GEOMETRIC = 1; |
143 }; | 157 }; |
144 optional ResourceWeightFunction resource_weight_function = 11 | 158 optional ResourceWeightFunction resource_weight_function = 11 |
145 [default = FUNCTION_NAIVE]; | 159 [default = FUNCTION_NAIVE]; |
146 }; | 160 }; |
OLD | NEW |