| 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 | 17 |
| 18 // A manifest of cacheable resources to be precached for a specific host. | 18 // A manifest of cacheable resources to be precached for a specific host. |
| 19 message PrecacheManifest { | 19 message PrecacheManifest { |
| 20 // List of resources that we predict that the user will need if they are | 20 // List of resources that we predict that the user will need if they are |
| 21 // likely to fetch the host. | 21 // likely to fetch the host. |
| 22 repeated PrecacheResource resource = 1; | 22 repeated PrecacheResource resource = 1; |
| 23 |
| 24 // Experiments running on this manifest. |
| 25 optional PrecacheExperiments experiments = 2; |
| 23 }; | 26 }; |
| 24 | 27 |
| 28 message PrecacheExperiments { |
| 29 // A mapping between experiment groups and the resources that should be |
| 30 // considered for the experiment. |
| 31 map<fixed32, PrecacheResourceSelection> resources_by_experiment_group = 1; |
| 32 } |
| 33 |
| 34 message PrecacheResourceSelection { |
| 35 // Select the resources as a std::bitset over the resources listed in the |
| 36 // manifest. |
| 37 // |
| 38 // The bitset should be loaded as: |
| 39 // std::bitset selection(resource_selection.bitset()); |
| 40 // Then manifest.resource(i) is selected for the experiment iff |
| 41 // selection.test(i). |
| 42 // |
| 43 // A missing bitset means that the experiment applies to all the resources. |
| 44 optional fixed64 bitset = 1 [default = 0xFFFFFFFFFFFFFFFF]; |
| 45 } |
| 46 |
| 25 message PrecacheConfigurationSettings { | 47 message PrecacheConfigurationSettings { |
| 26 // The maximum rank of the user's most visited hosts to consider precaching | 48 // The maximum rank of the user's most visited hosts to consider precaching |
| 27 // resources for, starting from 1. For example, a value of 10 means that only | 49 // resources for, starting from 1. For example, a value of 10 means that only |
| 28 // hosts that are in the user's top 10 most visited hosts will be considered | 50 // hosts that are in the user's top 10 most visited hosts will be considered |
| 29 // as starting URLs for resource precaching. This is specified by the server | 51 // as starting URLs for resource precaching. This is specified by the server |
| 30 // for testing purposes, so that it's easy to adjust how aggressively | 52 // for testing purposes, so that it's easy to adjust how aggressively |
| 31 // resources are precached. | 53 // resources are precached. |
| 32 // Values that are zero or lower indicate that none of the user's top sites | 54 // Values that are zero or lower indicate that none of the user's top sites |
| 33 // will be used for precaching. | 55 // will be used for precaching. |
| 34 optional int64 top_sites_count = 1 [default = 100]; | 56 optional int64 top_sites_count = 1 [default = 100]; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 46 // resources larger than this will be cancelled. This max applies only to new | 68 // resources larger than this will be cancelled. This max applies only to new |
| 47 // downloads; cached resources are not capped. | 69 // downloads; cached resources are not capped. |
| 48 optional uint64 max_bytes_per_resource = 4 [default = 500000 /* 500 KB */]; | 70 optional uint64 max_bytes_per_resource = 4 [default = 500000 /* 500 KB */]; |
| 49 | 71 |
| 50 // The maximum number of bytes per precache run. While precaching, the total | 72 // The maximum number of bytes per precache run. While precaching, the total |
| 51 // number of bytes used for resources is tallied -- this includes new | 73 // number of bytes used for resources is tallied -- this includes new |
| 52 // downloads as well as cached resources. After this limit is reached, no | 74 // downloads as well as cached resources. After this limit is reached, no |
| 53 // other resources will be downloaded. | 75 // other resources will be downloaded. |
| 54 optional uint64 max_bytes_total = 5 [default = 10000000 /* 10 MB */]; | 76 optional uint64 max_bytes_total = 5 [default = 10000000 /* 10 MB */]; |
| 55 }; | 77 }; |
| OLD | NEW |