// 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; // A percent value to inflate the number of received bytes by for the purposes // of data savings calculations in the client. // // If this value is set to 0, the client should use its configured default. // // Ex: If the received bytes is 100 and the inflation_percent is 30, the // inflated bytes calculated by the client will be 30 in order to have a total // consumed bytes value of 130. optional int64 inflation_percent = 2; } 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; }