| // Copyright 2015 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 data_reduction_proxy; |
| |
| // The client configuration information for using the Data Saver service. |
| message ClientConfig { |
| // An opaque per-session key assigned by the server which permits use of the |
| // Data Saver HTTP proxy servers. |
| optional string session_key = 1; |
| // The time at which the client should request a new configuration. The |
| // session_key is guaranteed to be valid through this time and may be valid |
| // for some time thereafter. |
| optional Timestamp DEPRECATED_refresh_time = 2 [deprecated = true]; |
| // The proxy configuration the client should use to connect to the Data Saver |
| // service. |
| optional ProxyConfig proxy_config = 3; |
| // The duration after which the client should request a new configuration. The |
| // session_key is guaranteed to be valid through this time and may be valid |
| // for some time thereafter. If both refresh_duration and refresh_time are |
| // present, refresh_duration should take priority. |
| optional Duration refresh_duration = 4; |
| // Configuration information for reporting pageload metrics. |
| optional PageloadMetricsConfig pageload_metrics_config = 5; |
| // Prevents the host base and user base blacklisting behaviors for lite pages |
| // and server LoFi. |
| optional bool ignore_long_term_black_list_rules = 7; |
| } |
| |
| // The configuration for reporting pageload metrics. |
| message PageloadMetricsConfig { |
| // The fraction of pageloads for which to report pageload metrics. |
| optional float reporting_fraction = 1; |
| } |
| |
| // N.B.: |
| // The configuration service that sends the ClientConfig uses Timestamp and |
| // Duration to conform to Google API standards. These proto messages should |
| // live in a shared location in the Chromium tree, but for now we duplicate |
| // them here. |
| |
| // A Timestamp represents a point in time independent of any time zone |
| // or calendar, represented as seconds and fractions of seconds at |
| // nanosecond resolution in UTC Epoch time. |
| message Timestamp { |
| // Represents seconds of UTC time since Unix epoch |
| // 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to |
| // 9999-12-31T23:59:59Z inclusive. |
| optional int64 seconds = 1; |
| |
| // Non-negative fractions of a second at nanosecond resolution. Negative |
| // second values with fractions must still have non-negative nanos values |
| // that count forward in time. Must be from 0 to 999,999,999 |
| // inclusive. |
| optional int32 nanos = 2; |
| } |
| |
| // A Duration represents a signed, fixed-length span of time represented |
| // as a count of seconds and fractions of seconds at nanosecond |
| // resolution. It is independent of any calendar and concepts like "day" |
| // or "month". It is related to Timestamp in that the difference between |
| // two Timestamp values is a Duration and it can be added or subtracted |
| // from a Timestamp. Range is approximately +-10,000 years. |
| message Duration { |
| // Signed seconds of the span of time. Must be from -315,576,000,000 |
| // to +315,576,000,000 inclusive. |
| optional int64 seconds = 1; |
| |
| // Signed fractions of a second at nanosecond resolution of the span |
| // of time. Durations less than one second are represented with a 0 |
| // `seconds` field and a positive or negative `nanos` field. For durations |
| // of one second or more, a non-zero value for the `nanos` field must be |
| // of the same sign as the `seconds` field. Must be from -999,999,999 |
| // to +999,999,999 inclusive. |
| optional int32 nanos = 2; |
| } |
| |
| // Data Saver proxy configuration. |
| message ProxyConfig { |
| // Provides proxy server information for HTTP URIs. |
| repeated ProxyServer http_proxy_servers = 1; |
| } |
| |
| // Configuration information for a specific proxy server. |
| message ProxyServer { |
| // The scheme of the proxy server. |
| enum ProxyScheme { |
| // The proxy scheme is unspecified. |
| UNSPECIFIED = 0; |
| // HTTP |
| HTTP = 1; |
| // HTTPS |
| HTTPS = 2; |
| // HTTPS over QUIC |
| DEPRECATED_QUIC = 3 [deprecated = true]; |
| } |
| |
| // The deployment type of the proxy server. |
| enum ProxyType { |
| // The proxy type is unspecified. |
| UNSPECIFIED_TYPE = 0; |
| // Core Google datacenter. |
| CORE = 1; |
| } |
| |
| // The scheme for the proxy server. |
| optional ProxyScheme scheme = 1; |
| // The host name for the proxy server. |
| optional string host = 2; |
| // The port number for the proxy server. |
| optional int32 port = 3; |
| // The type for the proxy server. |
| optional ProxyType type = 4; |
| } |
| |
| // Information about the device the user is on. |
| message ConfigDeviceInfo { |
| // Kilobytes of total device memory. |
| optional int64 total_device_memory_kb = 1; |
| } |
| |
| // Request object to create a client configuration object. |
| message CreateClientConfigRequest { |
| // An enum representing the type of user regarding whether they are dogfooding |
| // Chrome. |
| enum DogfoodGroup { |
| // The user dogfood group is not specified. |
| UNSPECIFIED = 0; |
| // The user is not a Chrome dogfooder. |
| NONDOGFOOD = 1; |
| // The user is a Chrome dogfooder. |
| DOGFOOD = 2; |
| } |
| |
| // A previous per-session key that was assigned by the service. |
| optional string session_key = 1; |
| |
| // Build version information. |
| optional VersionInfo version_info = 2; |
| |
| // The MCC/MNC of the telephony network operator. Represented as a string of |
| // the two numbers concatenated. E.g., "310260" for T-Mobile. Empty string if |
| // the user is not on android or if the user is on WiFi. |
| // Added in M65. |
| optional string telephony_network_operator = 3; |
| |
| // The DogfoodGroup of the user. |
| // Added in M65. |
| optional DogfoodGroup dogfood_group = 4; |
| |
| // Added in M65. |
| optional ConfigDeviceInfo device_info = 5; |
| } |
| |
| // Build version information. |
| message VersionInfo { |
| // The client's platform type. See |
| // components/data_reduction_proxy/core/common/data_reduction_proxy_util.h for |
| // allowed strings in CLIENT_ENUMS_LIST. |
| optional string client = 1; |
| |
| // The build number, e.g. 2171 |
| optional int32 build = 2; |
| |
| // The patch number of the chromium client: always a non-negative integer. |
| optional int32 patch = 3; |
| |
| // The production channel, e.g. "canary", "dev", "beta", "stable". |
| optional string channel = 4; |
| } |