| // Copyright 2016 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // Protocol buffers used for storing in SQLite. |
| // CAUTION: When any change is done here, bump kDatabaseVersion in |
| // resource_prefetch_predictor_tables.h. |
| |
| syntax = "proto2"; |
| |
| package predictors; |
| |
| // Required in Chrome. |
| option optimize_for = LITE_RUNTIME; |
| |
| // Represents a single subresource. |
| message ResourceData { |
| // Mirrors content::ResourceType. |
| enum ResourceType { |
| RESOURCE_TYPE_MAIN_FRAME = 0; |
| RESOURCE_TYPE_SUB_FRAME = 1; |
| RESOURCE_TYPE_STYLESHEET = 2; |
| RESOURCE_TYPE_SCRIPT = 3; |
| RESOURCE_TYPE_IMAGE = 4; |
| RESOURCE_TYPE_FONT_RESOURCE = 5; |
| RESOURCE_TYPE_SUB_RESOURCE = 6; |
| RESOURCE_TYPE_OBJECT = 7; |
| RESOURCE_TYPE_MEDIA = 8; |
| RESOURCE_TYPE_WORKER = 9; |
| RESOURCE_TYPE_SHARED_WORKER = 10; |
| RESOURCE_TYPE_PREFETCH = 11; |
| RESOURCE_TYPE_FAVICON = 12; |
| RESOURCE_TYPE_XHR = 13; |
| RESOURCE_TYPE_PING = 14; |
| RESOURCE_TYPE_SERVICE_WORKER = 15; |
| RESOURCE_TYPE_CSP_REPORT = 16; |
| RESOURCE_TYPE_PLUGIN_RESOURCE = 17; |
| RESOURCE_TYPE_LAST_TYPE = 18; |
| } |
| |
| // Mirrors net::RequestPriority |
| enum Priority { |
| REQUEST_PRIORITY_THROTTLED = 0; |
| REQUEST_PRIORITY_IDLE = 1; |
| REQUEST_PRIORITY_LOWEST = 2; |
| REQUEST_PRIORITY_LOW = 3; |
| REQUEST_PRIORITY_MEDIUM = 4; |
| REQUEST_PRIORITY_HIGHEST = 5; |
| } |
| |
| optional string resource_url = 1; |
| optional ResourceType resource_type = 2; |
| optional uint32 number_of_hits = 3; |
| optional uint32 number_of_misses = 4; |
| optional uint32 consecutive_misses = 5; |
| optional double average_position = 6; |
| optional Priority priority = 7; |
| optional bool has_validators = 8; |
| optional bool always_revalidate = 9; |
| } |
| |
| // Represents a collection of subresources associated with URL or host. |
| message PrefetchData { |
| // Main frame URL of host. |
| optional string primary_key = 1; |
| optional uint64 last_visit_time = 2; |
| repeated ResourceData resources = 3; |
| } |
| |
| // Represents a mapping from URL or host to a list of redirect endpoints. |
| message RedirectData { |
| // Represents a single redirect chain endpoint. |
| message RedirectStat { |
| // Represents the host for RedirectData in a host-based table. |
| optional string url = 1; |
| optional uint32 number_of_hits = 2; |
| optional uint32 number_of_misses = 3; |
| optional uint32 consecutive_misses = 4; |
| } |
| |
| // Main frame URL or host. |
| optional string primary_key = 1; |
| optional uint64 last_visit_time = 2; |
| repeated RedirectStat redirect_endpoints = 3; |
| } |