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

Side by Side Diff: components/precache/core/proto/precache.proto

Issue 2403193002: Precache: Optionally rank resources-to-precache globally. (Closed)
Patch Set: Code readability improvements per bengr. Created 4 years, 2 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;
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
20 // How important this resource is for the host. It ranges from 0.0 to 1.0.
21 // Higher values mean more important.
22 optional double weight_ratio = 3;
19 }; 23 };
20 24
21 message PrecacheManifestId { 25 message PrecacheManifestId {
22 optional int64 id = 1; 26 optional int64 id = 1;
23 }; 27 };
24 28
25 // A manifest of cacheable resources to be precached for a specific host. 29 // A manifest of cacheable resources to be precached for a specific host.
26 message PrecacheManifest { 30 message PrecacheManifest {
27 // List of resources that we predict that the user will need if they are 31 // List of resources that we predict that the user will need if they are
28 // likely to fetch the host. 32 // likely to fetch the host.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // Values that are zero or lower indicate that none of the user's top sites 68 // Values that are zero or lower indicate that none of the user's top sites
65 // will be used for precaching. 69 // will be used for precaching.
66 optional int64 top_sites_count = 1 [default = 100]; 70 optional int64 top_sites_count = 1 [default = 100];
67 71
68 // List of additional hosts that resources will be precached for. 72 // List of additional hosts that resources will be precached for.
69 // These are hosts that the server predicts that the user will visit, as a 73 // These are hosts that the server predicts that the user will visit, as a
70 // result of server-side analytics. 74 // result of server-side analytics.
71 repeated string forced_site = 2; 75 repeated string forced_site = 2;
72 76
73 // The number of resources to fetch for each site. Only the top 77 // The number of resources to fetch for each site. Only the top
74 // |top_resources_count| URLs from each manifest are fetched. 78 // |top_resources_count| URLs from each manifest are fetched. Not applicable
79 // if global ranking is enabled.
75 optional int32 top_resources_count = 3 [default = 100]; 80 optional int32 top_resources_count = 3 [default = 100];
76 81
77 // The maximum number of bytes to download per resource. Downloads of 82 // The maximum number of bytes to download per resource. Downloads of
78 // resources larger than this will be cancelled. This max applies only to new 83 // resources larger than this will be cancelled. This max applies only to new
79 // downloads; cached resources are not capped. 84 // downloads; cached resources are not capped.
80 optional uint64 max_bytes_per_resource = 4 [default = 500000 /* 500 KB */]; 85 optional uint64 max_bytes_per_resource = 4 [default = 500000 /* 500 KB */];
81 86
82 // The maximum number of bytes per precache run. While precaching, the total 87 // The maximum number of bytes per precache run. While precaching, the total
83 // number of bytes used for resources is tallied -- this includes new 88 // number of bytes used for resources is tallied -- this includes new
84 // downloads as well as cached resources. After this limit is reached, no 89 // downloads as well as cached resources. After this limit is reached, no
85 // other resources will be downloaded. 90 // other resources will be downloaded.
86 optional uint64 max_bytes_total = 5 [default = 10000000 /* 10 MB */]; 91 optional uint64 max_bytes_total = 5 [default = 10000000 /* 10 MB */];
87 92
88 // The maximum number of bytes that can be fetched by precache on a single 93 // The maximum number of bytes that can be fetched by precache on a single
89 // day. After this limit is reached, no more resources will be downloaded, 94 // day. After this limit is reached, no more resources will be downloaded,
90 // until the quota gets replenished the next day. 95 // until the quota gets replenished the next day.
91 optional uint64 daily_quota_total = 6 [default = 40000000 /* 10 MB */]; 96 optional uint64 daily_quota_total = 6 [default = 40000000 /* 10 MB */];
97
98 // The number of resources to fetch per precache run. Only the first
99 // |total_resources_count| URLs are fetched, regardless of whether global
100 // ranking is enabled.
101 optional uint32 total_resources_count = 7 [default = 999999];
102
103 // The minimum visit-adjusted weight for which a resource will be downloaded.
104 // Only applicable if global ranking is enabled.
105 optional double min_weight = 8 [default = 0];
92 }; 106 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698