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

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

Issue 2388783002: predictors: Refactor resource_prefetch_predictor_tables. (Closed)
Patch Set: Rebase. 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 // Represents a single subresource.
17 optional string main_page_url = 1;
18 optional uint64 last_visit_time = 2;
19 }
20
21 message ResourceData { 17 message ResourceData {
22 // Mirrors content::ResourceType. 18 // Mirrors content::ResourceType.
23 enum ResourceType { 19 enum ResourceType {
24 RESOURCE_TYPE_MAIN_FRAME = 0; 20 RESOURCE_TYPE_MAIN_FRAME = 0;
25 RESOURCE_TYPE_SUB_FRAME = 1; 21 RESOURCE_TYPE_SUB_FRAME = 1;
26 RESOURCE_TYPE_STYLESHEET = 2; 22 RESOURCE_TYPE_STYLESHEET = 2;
27 RESOURCE_TYPE_SCRIPT = 3; 23 RESOURCE_TYPE_SCRIPT = 3;
28 RESOURCE_TYPE_IMAGE = 4; 24 RESOURCE_TYPE_IMAGE = 4;
29 RESOURCE_TYPE_FONT_RESOURCE = 5; 25 RESOURCE_TYPE_FONT_RESOURCE = 5;
30 RESOURCE_TYPE_SUB_RESOURCE = 6; 26 RESOURCE_TYPE_SUB_RESOURCE = 6;
(...skipping 24 matching lines...) Expand all
55 optional ResourceType resource_type = 2; 51 optional ResourceType resource_type = 2;
56 optional uint32 number_of_hits = 3; 52 optional uint32 number_of_hits = 3;
57 optional uint32 number_of_misses = 4; 53 optional uint32 number_of_misses = 4;
58 optional uint32 consecutive_misses = 5; 54 optional uint32 consecutive_misses = 5;
59 optional double average_position = 6; 55 optional double average_position = 6;
60 optional Priority priority = 7; 56 optional Priority priority = 7;
61 optional bool has_validators = 8; 57 optional bool has_validators = 8;
62 optional bool always_revalidate = 9; 58 optional bool always_revalidate = 9;
63 } 59 }
64 60
61 // Represents a collection of subresources associated with URL or host.
62 message PrefetchData {
63 // Main frame URL of host.
64 optional string primary_key = 1;
65 optional uint64 last_visit_time = 2;
66 repeated ResourceData resources = 3;
67 }
68
65 // Represents a mapping from URL or host to a list of redirect endpoints. 69 // Represents a mapping from URL or host to a list of redirect endpoints.
66 message RedirectData { 70 message RedirectData {
67 // Represents a single redirect chain endpoint. 71 // Represents a single redirect chain endpoint.
68 message RedirectStat { 72 message RedirectStat {
69 // Represents the host for RedirectData in a host-based table. 73 // Represents the host for RedirectData in a host-based table.
70 optional string url = 1; 74 optional string url = 1;
71 optional uint32 number_of_hits = 2; 75 optional uint32 number_of_hits = 2;
72 optional uint32 number_of_misses = 3; 76 optional uint32 number_of_misses = 3;
73 optional uint32 consecutive_misses = 4; 77 optional uint32 consecutive_misses = 4;
74 } 78 }
75 79
76 // Represents main frame URL or host. 80 // Main frame URL or host.
77 optional string primary_key = 1; 81 optional string primary_key = 1;
78 optional uint64 last_visit_time = 2; 82 optional uint64 last_visit_time = 2;
79 repeated RedirectStat redirect_endpoints = 3; 83 repeated RedirectStat redirect_endpoints = 3;
80 } 84 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698