blob: 939918dcf7b4b42b38e99b3e7e6a5c6e734e8186 [file] [log] [blame]
// Copyright 2017 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.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package optimization_guide.proto;
enum OptimizationType {
TYPE_UNSPECIFIED = 0;
// This optimization blocks Javascript on the page.
NOSCRIPT = 1;
}
// Presents semantics for how page load URLs should be matched.
enum KeyRepresentation {
REPRESENTATION_UNSPECIFIED = 0;
// The suffix to match in the hostname of a page load URL.
// Example: A host suffix of cnn.com would match pages with host
// sports.cnn.com, but not foocnn.com.
HOST_SUFFIX = 1;
}
message Optimization {
// The type of optimization the hint applies to.
optional OptimizationType optimization_type = 1;
}
message Hint {
// Describes the granularity of the key field.
optional KeyRepresentation key_representation = 1;
// The key that applies to this hint. The key_representation field describes
// the form in which this key takes. Guaranteed to be non-empty.
optional string key = 2;
// An unordered, non-empty set of optimizations that should be whitelisted for
// this hint.
repeated Optimization whitelisted_optimizations = 3;
}
message Configuration {
// An unordered list containing hints for key/optimization combinations.
// It is guaranteed that there will only be a single hint per key and key
// representation combination. These hints are intended to apply to a full
// page.
//
// Note, this list may contain multiple hints that apply to a page. For
// example, if there are hints for (HOST_SUFFIX,cnn.com) and
// (HOST_SUFFIX,sports.cnn.com), these may both apply to sports.cnn.com/foo.
//
// It is expected for the client to use the first match in this list.
repeated Hint hints = 1;
}