Skip to content

Commit

Permalink
feed: Sync protos with upstream
Browse files Browse the repository at this point in the history
Change-Id: I953964590ea913a14d404052af5923417cd96b2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2702112
Commit-Queue: Dan H <harringtond@chromium.org>
Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#859126}
  • Loading branch information
Dan Harrington authored and Chromium LUCI CQ committed Mar 2, 2021
1 parent f9f096e commit 7b9af21
Show file tree
Hide file tree
Showing 58 changed files with 380 additions and 485 deletions.
18 changes: 12 additions & 6 deletions components/feed/core/proto/BUILD.gn
Expand Up @@ -11,29 +11,29 @@ if (is_android) {
proto_library("proto_v2") {
proto_in_dir = "../../../../"
sources = [
#UNUSED_IN_CHROME "v2/wire/feed_id.proto",
#UNUSED_IN_CHROME "v2/wire/in_place_update_handle.proto",
#UNUSED_IN_CHROME "v2/wire/response_status_code.proto",
#UNUSED_IN_CHROME "v2/wire/templates.proto",
"v2/keyvalue_store.proto",
"v2/packing.proto",
"v2/store.proto",
"v2/ui.proto",
"v2/wire/action_diagnostic_info.proto",
"v2/wire/action_payload.proto",
"v2/wire/capability.proto",
"v2/wire/chrome_client_info.proto",
"v2/wire/chrome_feed_response_metadata.proto",
"v2/wire/chrome_fulfillment_info.proto",
"v2/wire/client_info.proto",
"v2/wire/color.proto",
"v2/wire/consistency_token.proto",
"v2/wire/content_id.proto",
"v2/wire/data_operation.proto",
"v2/wire/discover_actions_service.proto",
"v2/wire/device.proto",
"v2/wire/diagnostic_info.proto",
"v2/wire/display_info.proto",
"v2/wire/duration.proto",
"v2/wire/expiration_info.proto",
"v2/wire/feature.proto",
"v2/wire/feed_action.proto",
"v2/wire/feed_entry_point_data.proto",
"v2/wire/feed_query.proto",
"v2/wire/feed_request.proto",
"v2/wire/feed_response.proto",
Expand All @@ -43,11 +43,17 @@ proto_library("proto_v2") {
"v2/wire/request.proto",
"v2/wire/request_schedule.proto",
"v2/wire/response.proto",
"v2/wire/server_experiment_data.proto",
"v2/wire/stream_structure.proto",
"v2/wire/there_and_back_again_data.proto",
"v2/wire/token.proto",
"v2/wire/upload_actions_request.proto",
"v2/wire/upload_actions_response.proto",
"v2/wire/version.proto",
"v2/wire/web_feeds.proto",
"v2/wire/web_feed.proto",
"v2/wire/wrappers.proto",
"v2/wire/xsurface_container.proto",
"v2/wire/xsurface_content.proto",
"v2/xsurface.proto",
]
}
Expand Down
Expand Up @@ -8,6 +8,6 @@ package feedwire;

option optimize_for = LITE_RUNTIME;

// UNUSED_IN_CHROME message FeedId {
// UNUSED_IN_CHROME extensions 1 to 6;
// UNUSED_IN_CHROME }
message ActionDiagnosticInfo {
optional int32 actions_remaining = 1;
}
10 changes: 1 addition & 9 deletions components/feed/core/proto/v2/wire/action_payload.proto
Expand Up @@ -8,14 +8,6 @@ package feedwire;

option optimize_for = LITE_RUNTIME;

// The data needed by the server to handle action recording. This information is
// opaque to the client and will be the information that is round-tripped so the
// server can properly handle the action. For the Not Interested In action, this
// data will contain the ids needed to record that the user is not interested
// in that particular topic or source.
// NOTE: it is important to keep this to a bare minimum amount of data.
message ActionPayload {
// Reserved fields for renderable unit extensions
// Please use CL numbers you own for extension numbers.
extensions 257605906; // ActionPayloadData
optional bytes action_payload_data = 257605906;
}
13 changes: 4 additions & 9 deletions components/feed/core/proto/v2/wire/capability.proto
Expand Up @@ -8,27 +8,22 @@ package feedwire;

option optimize_for = LITE_RUNTIME;

// Feature capability of either the client or the server.
enum Capability {
UNKNOWN_CAPABILITY = 0;
// The client is capable of a basic UI.
BASE_UI = 1;
BASE_UI = 1 [deprecated = true];
INFINITE_FEED = 5;
DISMISS_COMMAND = 9;
UNDO_FOR_DISMISS_COMMAND = 10;
REDACTED_11 = 11;
// UNUSED_IN_CHROME HEIRLOOMED_FEED = 13;
// UNUSED_IN_CHROME SPORTS_FEATURE = 14;
// UNUSED_IN_CHROME PAID_CONTENT = 15;
// UNUSED_IN_CHROME OPEN_VIDEO_COMMAND = 16;
SPORTS_IN_GAME_UPDATE = 35;
PERSIST_GAME_CONTENT = 46;
UI_THEME_V2 = 17;
// UNUSED_IN_CHROME INLINE_VIDEO_AUTOPLAY = 18;
CARD_MENU = 19;
REQUEST_SCHEDULE = 20;
HEART = 23;
SHARE = 24;
OPEN_IN_TAB = 27;
DOWNLOAD_LINK = 28;
READ_LATER = 30;
LOTTIE_ANIMATIONS = 37;
LONG_PRESS_CARD_MENU = 38;
PREFETCH_METADATA = 43;
Expand Down
4 changes: 0 additions & 4 deletions components/feed/core/proto/v2/wire/chrome_client_info.proto
Expand Up @@ -8,10 +8,6 @@ package feedwire;

option optimize_for = LITE_RUNTIME;

// Information about the client performing the request, relevant only to Chrome
// surfaces.
message ChromeClientInfo {
// The signed-out session identifier (Zwieback) token, for clients which embed
// this information in-band instead of using an HTTP Cookie.
optional string session_id = 3;
}
Expand Up @@ -14,7 +14,6 @@ message ChromeFeedResponseMetadata {
optional string session_id = 3;
repeated Experiment experiments = 4;
}

message Experiment {
optional string trial_name = 1;
optional string group_name = 2;
Expand Down
Expand Up @@ -8,10 +8,6 @@ package feedwire;

option optimize_for = LITE_RUNTIME;

// Information on how to do content fulfillment for Chrome.
message ChromeFulfillmentInfo {
// Whether the notice card has already been acknowledged by the user based on
// their views and clicks on the card. This is different from when the user
// explicitly dismiss the notice card by touching the button.
optional bool notice_card_acknowledged = 1;
}
44 changes: 6 additions & 38 deletions components/feed/core/proto/v2/wire/client_info.proto
Expand Up @@ -6,61 +6,29 @@ syntax = "proto2";

package feedwire;

option optimize_for = LITE_RUNTIME;

import "components/feed/core/proto/v2/wire/chrome_client_info.proto";
import "components/feed/core/proto/v2/wire/device.proto";
import "components/feed/core/proto/v2/wire/display_info.proto";
import "components/feed/core/proto/v2/wire/version.proto";

// Information about the client performing the request similar to a user-agent
// string in HTTP.
// Next ID: 10.
option optimize_for = LITE_RUNTIME;

message ClientInfo {
enum PlatformType {
UNKNOWN_PLATFORM = 0;
ANDROID_ID = 1; // ANDROID collides with a C++ preprocessor macro.
ANDROID_ID = 1;
IOS = 2;
}

enum AppType { CLANK = 3; }

// The type of OS that the client is running.
enum AppType { CHROME_ANDROID = 3; }
optional PlatformType platform_type = 1;

// The version of the OS that the client is running.
optional Version platform_version = 2;

// The type of client app.
optional AppType app_type = 3;

// The version of the client app.
optional Version app_version = 4;

// A string identifying the language and region preferences of the client.
// Follows the BCP 47 format such as "en-US" or "fr-CA"
optional string locale = 5;

// The information about the screen of the client. This is repeated because
// there are some devices that might have multiple display screens.
// (Ex fold-able phones)
repeated DisplayInfo display_info = 6;

// Identifier of the user's device. For Android devices, contains a hash of
// the gaia email and android_id, which uniquely identifies the device for
// the user. Currently set by Android clients version 4.1 and later.
optional string client_instance_id = 7;

// An Android device level identifier used for advertising, required for
// conversion tracking, see more at:
// https://support.google.com/googleplay/android-developer/answer/6048248
optional string advertising_id = 8;

// Two-letter country code as detected by the device. On Android devices,
// this comes from GServices check-in which uses the SIM card MCC (mobile
// country code), with fallback to IP geo lookup.
optional string device_country = 9;

// Information about the client performing the request, relevant only to
// Chrome surfaces.
optional Device device = 10;
optional ChromeClientInfo chrome_client_info = 338478298;
}
18 changes: 18 additions & 0 deletions components/feed/core/proto/v2/wire/color.proto
@@ -0,0 +1,18 @@
// Copyright 2020 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 = "proto3";

package feedwire;

import "components/feed/core/proto/v2/wire/wrappers.proto";

option optimize_for = LITE_RUNTIME;

message Color {
float red = 1;
float green = 2;
float blue = 3;
FloatValue alpha = 4;
}
2 changes: 0 additions & 2 deletions components/feed/core/proto/v2/wire/consistency_token.proto
Expand Up @@ -8,8 +8,6 @@ package feedwire;

option optimize_for = LITE_RUNTIME;

// A consistency token.
message ConsistencyToken {
// Indicates the min version of storage to read from.
optional bytes token = 1;
}
33 changes: 2 additions & 31 deletions components/feed/core/proto/v2/wire/content_id.proto
Expand Up @@ -8,42 +8,13 @@ package feedwire;

option optimize_for = LITE_RUNTIME;

// An identifier for a piece of content served by Now or delivered to the Now
// client(s).
// See [INTERNAL LINK] for the design of this feature.
// ContentId comprises a unique key for all content. The client will never have
// more than one piece of content with the same ContentID.
message ContentId {
optional string content_domain = 1;

// The type of content this represents. Generally, this is somewhat redundant,
// as this ContentId proto will be embedded within a particular parent proto
// that implies its type. It is repeated here for the purpose of making
// ContentId fully self-contained, able to completely specify a piece of
// content's ID without additional context.
// Since Type is one of the components of content's uniqueness, it is safe
// and reasonable for two related pieces of content with different types
// (e.g. a card and its attached notification) to share the same id and
// content_domain, and to differ only in their type. However, Type is **not**
// included when determing if two ContentIds are equivalent.
enum Type {
// Undefined type - DO NOT USE
TYPE_UNDEFINED = 0;
CARD = 1;
CLUSTER = 3;
// A feature, which is the indivisible unit of Feed content.
FEATURE = 4;
// A ContentId used only for identifying nodes in a tree structure.
TREE_STRUCTURE = 7;
// A ContentId for a collection.
COLLECTION = 8;
// A ContentId for a token, e.g. a NextPage token.
TOKEN = 9;

reserved 2;
}
// The type of content this represents
optional Type type = 2;

optional string content_domain = 1;
optional int32 type = 2;
optional fixed64 id = 3;
}
34 changes: 5 additions & 29 deletions components/feed/core/proto/v2/wire/data_operation.proto
Expand Up @@ -6,51 +6,27 @@ syntax = "proto2";

package feedwire;

option optimize_for = LITE_RUNTIME;

import "components/feed/core/proto/v2/wire/feature.proto";
// UNUSED_IN_CHROME import
// "components/feed/core/proto/v2/wire/in_place_update_handle.proto";
import "components/feed/core/proto/v2/wire/payload_metadata.proto";
import "components/feed/core/proto/v2/wire/render_data.proto";
// UNUSED_IN_CHROME import "components/feed/core/proto/v2/wire/templates.proto";
import "components/feed/core/proto/v2/wire/token.proto";
import "components/feed/core/proto/v2/wire/request_schedule.proto";
import "components/feed/core/proto/v2/wire/token.proto";

// An extensible operation to change the state of data on the client.
message DataOperation {
// Next tag: 8
option optimize_for = LITE_RUNTIME;

message DataOperation {
enum Operation {
UNKNOWN_OPERATION = 0;
// Remove all stored content of all types
CLEAR_ALL = 1;
// Update content if it exists, else append to the bottom of the feed
UPDATE_OR_APPEND = 2;
// Remove the item from the stream
REMOVE = 3;
}

// The operation to perform on the data.
optional Operation operation = 1;

// Data common to all payload types.
optional PayloadMetadata metadata = 2;

// The actual data being supplied.
oneof payload {
// A stream UI level feature such as a cluster or card.
Feature feature = 3;

// A token, capable of making a next page request.
Token next_page_token = 5;

// Information to help render the content in the response.
RenderData render_data = 6;

// UNUSED_IN_CHROME InPlaceUpdateHandle in_place_update_handle = 8;
// UNUSED_IN_CHROME Templates templates = 4 [deprecated = true];

RequestSchedule request_schedule = 9;
}
optional Operation operation = 1;
optional PayloadMetadata metadata = 2;
}
14 changes: 14 additions & 0 deletions components/feed/core/proto/v2/wire/device.proto
@@ -0,0 +1,14 @@
// Copyright 2020 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";

package feedwire;

option optimize_for = LITE_RUNTIME;

message Device {
optional string manufacturer = 1;
optional string model = 2;
}
14 changes: 14 additions & 0 deletions components/feed/core/proto/v2/wire/diagnostic_info.proto
@@ -0,0 +1,14 @@
// Copyright 2020 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";

package feedwire;

option optimize_for = LITE_RUNTIME;

message DiagnosticInfo {
optional int32 actions_remaining = 1;
optional int64 last_successful_refresh_time_usec = 2;
}
9 changes: 0 additions & 9 deletions components/feed/core/proto/v2/wire/display_info.proto
Expand Up @@ -8,17 +8,8 @@ package feedwire;

option optimize_for = LITE_RUNTIME;

// The information about the client's screen.
// Next id: 4
message DisplayInfo {
// Density of the screen in physical pixels per density independent pixel
// (DIP); see:
// http://developer.android.com/reference/android/util/DisplayMetrics.html#density
optional float screen_density = 1;

// The width of the screen in pixels.
optional uint32 screen_width_in_pixels = 2;

// The height of the screen in pixels.
optional uint32 screen_height_in_pixels = 3;
}
1 change: 0 additions & 1 deletion components/feed/core/proto/v2/wire/duration.proto
Expand Up @@ -8,7 +8,6 @@ package feedwire;

option optimize_for = LITE_RUNTIME;

// Copy of third_party/protobuf/src/google/protobuf/duration.proto.
message Duration {
int64 seconds = 1;
int32 nanos = 2;
Expand Down

0 comments on commit 7b9af21

Please sign in to comment.