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

Side by Side Diff: chrome/browser/predictors/resource_prefetch_predictor.proto

Issue 2388783002: predictors: Refactor resource_prefetch_predictor_tables. (Closed)
Patch Set: 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 // Protocol buffers used for storing in SQLite. 5 // Protocol buffers used for storing in SQLite.
6 // CAUTION: When any change is done here, bump kDatabaseVersion in 6 // CAUTION: When any change is done here, bump kDatabaseVersion in
7 // resource_prefetch_predictor_tables.h. 7 // resource_prefetch_predictor_tables.h.
8 8
9 syntax = "proto2"; 9 syntax = "proto2";
10 10
11 package predictors; 11 package predictors;
12 12
13 // Required in Chrome. 13 // Required in Chrome.
14 option optimize_for = LITE_RUNTIME; 14 option optimize_for = LITE_RUNTIME;
15 15
16 message Metadata { 16 message Metadata {
17 optional string main_page_url = 1; 17 optional string main_page_url = 1;
18 optional uint64 last_visit_time = 2; 18 optional uint64 last_visit_time = 2;
19 } 19 }
20 20
21 message ResourceData { 21 // Represents collection of subresources associated with URL or host.
22 // Mirrors content::ResourceType. 22 message PrefetchData {
alexilin 2016/10/03 14:07:12 I also would like to rename these messages that re
23 enum ResourceType { 23 // Represents information about single subresource.
Benoit L 2016/10/04 08:22:42 You don't have to nest this message in this one. C
alexilin 2016/10/04 09:43:48 Done.
24 RESOURCE_TYPE_MAIN_FRAME = 0; 24 message ResourceData {
25 RESOURCE_TYPE_SUB_FRAME = 1; 25 // Mirrors content::ResourceType.
26 RESOURCE_TYPE_STYLESHEET = 2; 26 enum ResourceType {
27 RESOURCE_TYPE_SCRIPT = 3; 27 RESOURCE_TYPE_MAIN_FRAME = 0;
28 RESOURCE_TYPE_IMAGE = 4; 28 RESOURCE_TYPE_SUB_FRAME = 1;
29 RESOURCE_TYPE_FONT_RESOURCE = 5; 29 RESOURCE_TYPE_STYLESHEET = 2;
30 RESOURCE_TYPE_SUB_RESOURCE = 6; 30 RESOURCE_TYPE_SCRIPT = 3;
31 RESOURCE_TYPE_OBJECT = 7; 31 RESOURCE_TYPE_IMAGE = 4;
32 RESOURCE_TYPE_MEDIA = 8; 32 RESOURCE_TYPE_FONT_RESOURCE = 5;
33 RESOURCE_TYPE_WORKER = 9; 33 RESOURCE_TYPE_SUB_RESOURCE = 6;
34 RESOURCE_TYPE_SHARED_WORKER = 10; 34 RESOURCE_TYPE_OBJECT = 7;
35 RESOURCE_TYPE_PREFETCH = 11; 35 RESOURCE_TYPE_MEDIA = 8;
36 RESOURCE_TYPE_FAVICON = 12; 36 RESOURCE_TYPE_WORKER = 9;
37 RESOURCE_TYPE_XHR = 13; 37 RESOURCE_TYPE_SHARED_WORKER = 10;
38 RESOURCE_TYPE_PING = 14; 38 RESOURCE_TYPE_PREFETCH = 11;
39 RESOURCE_TYPE_SERVICE_WORKER = 15; 39 RESOURCE_TYPE_FAVICON = 12;
40 RESOURCE_TYPE_CSP_REPORT = 16; 40 RESOURCE_TYPE_XHR = 13;
41 RESOURCE_TYPE_PLUGIN_RESOURCE = 17; 41 RESOURCE_TYPE_PING = 14;
42 RESOURCE_TYPE_LAST_TYPE = 18; 42 RESOURCE_TYPE_SERVICE_WORKER = 15;
43 RESOURCE_TYPE_CSP_REPORT = 16;
44 RESOURCE_TYPE_PLUGIN_RESOURCE = 17;
45 RESOURCE_TYPE_LAST_TYPE = 18;
46 }
47
48 // Mirrors net::RequestPriority
49 enum Priority {
50 REQUEST_PRIORITY_IDLE = 0;
51 REQUEST_PRIORITY_LOWEST = 1;
52 REQUEST_PRIORITY_LOW = 2;
53 REQUEST_PRIORITY_MEDIUM = 3;
54 REQUEST_PRIORITY_HIGHEST = 4;
55 }
56
57 optional string resource_url = 1;
58 optional ResourceType resource_type = 2;
59 optional uint32 number_of_hits = 3;
60 optional uint32 number_of_misses = 4;
61 optional uint32 consecutive_misses = 5;
62 optional double average_position = 6;
63 optional Priority priority = 7;
64 optional bool has_validators = 8;
65 optional bool always_revalidate = 9;
43 } 66 }
44 67
45 // Mirrors net::RequestPriority 68 // Represents main frame URL of host.
46 enum Priority { 69 optional string primary_key = 1;
47 REQUEST_PRIORITY_IDLE = 0; 70 optional uint64 last_visit_time = 2;
48 REQUEST_PRIORITY_LOWEST = 1; 71 repeated ResourceData resources = 3;
49 REQUEST_PRIORITY_LOW = 2;
50 REQUEST_PRIORITY_MEDIUM = 3;
51 REQUEST_PRIORITY_HIGHEST = 4;
52 }
53
54 optional string resource_url = 1;
55 optional ResourceType resource_type = 2;
56 optional uint32 number_of_hits = 3;
57 optional uint32 number_of_misses = 4;
58 optional uint32 consecutive_misses = 5;
59 optional double average_position = 6;
60 optional Priority priority = 7;
61 optional bool has_validators = 8;
62 optional bool always_revalidate = 9;
63 } 72 }
64 73
65 // Represents a mapping from URL or host to a list of redirect endpoints. 74 // Represents a mapping from URL or host to a list of redirect endpoints.
66 message RedirectData { 75 message RedirectData {
67 // Represents a single redirect chain endpoint. 76 // Represents a single redirect chain endpoint.
68 message RedirectStat { 77 message RedirectStat {
69 // Represents the host for RedirectData in a host-based table. 78 // Represents the host for RedirectData in a host-based table.
70 optional string url = 1; 79 optional string url = 1;
71 optional uint32 number_of_hits = 2; 80 optional uint32 number_of_hits = 2;
72 optional uint32 number_of_misses = 3; 81 optional uint32 number_of_misses = 3;
73 optional uint32 consecutive_misses = 4; 82 optional uint32 consecutive_misses = 4;
74 } 83 }
75 84
76 // Represents main frame URL or host. 85 // Represents main frame URL or host.
77 optional string primary_key = 1; 86 optional string primary_key = 1;
78 optional uint64 last_visit_time = 2; 87 optional uint64 last_visit_time = 2;
79 repeated RedirectStat redirect_endpoints = 3; 88 repeated RedirectStat redirect_endpoints = 3;
80 } 89 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698