Commit 8f7971c2 authored by Sophie Chang's avatar Sophie Chang Committed by Commit Bot

Add proto changes for host-keyed hints

This should provide parity with google CL 323652109

Bug: 1110487
Change-Id: I3be1c9d94aca74ec97be502dbef586cf4e101489
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2324889
Commit-Queue: Sophie Chang <sophiechang@chromium.org>
Auto-Submit: Sophie Chang <sophiechang@chromium.org>
Reviewed-by: default avatarMichael Crouse <mcrouse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792553}
parent ff28bd8e
...@@ -294,6 +294,7 @@ bool HintCache::ProcessAndCacheHints( ...@@ -294,6 +294,7 @@ bool HintCache::ProcessAndCacheHints(
std::make_unique<MemoryHint>(expiry_time, std::move(hint))); std::make_unique<MemoryHint>(expiry_time, std::move(hint)));
} }
break; break;
case proto::HOST:
case proto::REPRESENTATION_UNSPECIFIED: case proto::REPRESENTATION_UNSPECIFIED:
NOTREACHED(); NOTREACHED();
break; break;
......
...@@ -54,6 +54,13 @@ message GetHintsRequest { ...@@ -54,6 +54,13 @@ message GetHintsRequest {
// optimizations present in this set. // optimizations present in this set.
repeated OptimizationType supported_optimizations = 2; repeated OptimizationType supported_optimizations = 2;
// The set of key representations that the client can process.
//
// It is guaranteed that the response will only contain hints for key
// representations present in this set. If not specified,
// [HOST_SUFFIX, FULL_URL] will be used.
repeated KeyRepresentation supported_key_representations = 5;
// Context in which this request is made. // Context in which this request is made.
optional RequestContext context = 3; optional RequestContext context = 3;
} }
...@@ -154,6 +161,10 @@ enum KeyRepresentation { ...@@ -154,6 +161,10 @@ enum KeyRepresentation {
// This will be an exact match of a page load URL, including query params and // This will be an exact match of a page load URL, including query params and
// fragments. // fragments.
FULL_URL = 2; FULL_URL = 2;
// The host to match.
//
// This will be an exact match of a page load host.
HOST = 3;
} }
message Optimization { message Optimization {
...@@ -210,13 +221,16 @@ message PageHint { ...@@ -210,13 +221,16 @@ message PageHint {
} }
message Hint { message Hint {
reserved 3;
// Describes the granularity of the key field. // Describes the granularity of the key field.
optional KeyRepresentation key_representation = 1; optional KeyRepresentation key_representation = 1;
// The key that applies to this hint. The key_representation field describes // The key that applies to this hint. The key_representation field describes
// the form in which this key takes. Guaranteed to be non-empty. // the form in which this key takes. Guaranteed to be non-empty.
optional string key = 2; optional string key = 2;
// An unordered set of optimizations that should be whitelisted for this
// hint.
//
// This field is currently only specified for key_representation of HOST.
repeated Optimization whitelisted_optimizations = 3;
// An ordered set of per-page hints. Only the first PageHint record // An ordered set of per-page hints. Only the first PageHint record
// that matches a committed page URL should be used for that page load. // that matches a committed page URL should be used for that page load.
repeated PageHint page_hints = 4; repeated PageHint page_hints = 4;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment