Commit 8cade3e0 authored by Dan Harrington's avatar Dan Harrington Committed by Commit Bot

feedv2: trim unused fields

Also add new chrome_feed_response_metadata.proto.

Unused fields result in binary bloat, so I've commented them
out with a marker 'UNUSED_IN_CHROME'. The idea is to make it
easy to add them back, and to prevent the same fields from being
merged back in.

This saves 3.4 KB on the apk

Bug: 1044139
Change-Id: I2a382da4a921a42da238498f6f296b35dd1c5977
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2354610
Commit-Queue: Dan H <harringtond@chromium.org>
Reviewed-by: default avatarIan Wells <iwells@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797925}
parent a3838b5d
......@@ -19,11 +19,16 @@ proto_library("proto") {
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/packing.proto",
"v2/store.proto",
"v2/ui.proto",
"v2/wire/action_payload.proto",
"v2/wire/capability.proto",
"v2/wire/chrome_feed_response_metadata.proto",
"v2/wire/client_info.proto",
"v2/wire/consistency_token.proto",
"v2/wire/content_id.proto",
......@@ -34,20 +39,16 @@ proto_library("proto_v2") {
"v2/wire/expiration_info.proto",
"v2/wire/feature.proto",
"v2/wire/feed_action.proto",
"v2/wire/feed_id.proto",
"v2/wire/feed_query.proto",
"v2/wire/feed_request.proto",
"v2/wire/feed_response.proto",
"v2/wire/in_place_update_handle.proto",
"v2/wire/next_page_token.proto",
"v2/wire/payload_metadata.proto",
"v2/wire/render_data.proto",
"v2/wire/request.proto",
"v2/wire/request_schedule.proto",
"v2/wire/response.proto",
"v2/wire/response_status_code.proto",
"v2/wire/stream_structure.proto",
"v2/wire/templates.proto",
"v2/wire/there_and_back_again_data.proto",
"v2/wire/token.proto",
"v2/wire/version.proto",
......
......@@ -14,30 +14,18 @@ enum Capability {
UNKNOWN_CAPABILITY = 0;
// The client is capable of a basic UI.
BASE_UI = 1;
INFINITE_FEED = 5;
// Enable Dismiss command
DISMISS_COMMAND = 9;
// Enable Undo in Dismiss
UNDO_FOR_DISMISS_COMMAND = 10;
REDACTED_11 = 11;
// The client is only considered capable of supporting a minimal heirloomed
// feed.
HEIRLOOMED_FEED = 13;
// The client is capable of supporting sports features.
SPORTS_FEATURE = 14;
// The client is capable of supporting ads content.
PAID_CONTENT = 15;
// Enable open video command.
OPEN_VIDEO_COMMAND = 16;
// Enable alternate UI theming.
// 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;
UI_THEME_V2 = 17;
// Enable inline video autoplay.
INLINE_VIDEO_AUTOPLAY = 18;
// Enable the card menu.
// UNUSED_IN_CHROME INLINE_VIDEO_AUTOPLAY = 18;
CARD_MENU = 19;
REQUEST_SCHEDULE = 20;
OPEN_IN_TAB = 27;
DOWNLOAD_LINK = 28;
reserved 2 to 4, 6 to 8, 12;
}
// 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 ChromeFeedResponseMetadata {
optional bool privacy_notice_fulfilled = 1;
}
......@@ -9,10 +9,11 @@ package feedwire;
option optimize_for = LITE_RUNTIME;
import "components/feed/core/proto/v2/wire/feature.proto";
import "components/feed/core/proto/v2/wire/in_place_update_handle.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";
import "components/feed/core/proto/v2/wire/templates.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";
......@@ -47,11 +48,8 @@ message DataOperation {
// Information to help render the content in the response.
RenderData render_data = 6;
// A handle for updating one or more pieces of content in place.
InPlaceUpdateHandle in_place_update_handle = 8;
// A collection of templates.
Templates templates = 4 [deprecated = true];
// UNUSED_IN_CHROME InPlaceUpdateHandle in_place_update_handle = 8;
// UNUSED_IN_CHROME Templates templates = 4 [deprecated = true];
RequestSchedule request_schedule = 9;
}
......
......@@ -8,13 +8,6 @@ package feedwire;
option optimize_for = LITE_RUNTIME;
// This proto is used to uniquely identify a Feed of cards.
// The main use case is for the paginated feed, storing multiple
// feeds on the server, and needing to identify them individually.
// It is an empty extension holder because the client should not ever know
// or care what's in the FeedId, and so we can change the definition
// of what a FeedId for the server without worrying about users possibly
// looking into the implementation details.
message FeedId {
extensions 1 to 6;
}
// UNUSED_IN_CHROME message FeedId {
// UNUSED_IN_CHROME extensions 1 to 6;
// UNUSED_IN_CHROME }
......@@ -11,7 +11,7 @@ option optimize_for = LITE_RUNTIME;
import "components/feed/core/proto/v2/wire/capability.proto";
import "components/feed/core/proto/v2/wire/client_info.proto";
import "components/feed/core/proto/v2/wire/consistency_token.proto";
import "components/feed/core/proto/v2/wire/feed_id.proto";
// UNUSED_IN_CHROME import "components/feed/core/proto/v2/wire/feed_id.proto";
import "components/feed/core/proto/v2/wire/feed_query.proto";
// Request to fetch new data for the feed
......@@ -31,7 +31,7 @@ message FeedRequest {
// Created on the server and used by the client to identify the feed when
// clients will store multiple infinite feeds.
// See [INTERNAL LINK]
repeated FeedId feed_ids_to_preserve = 12;
// UNUSED_IN_CHROME repeated FeedId feed_ids_to_preserve = 12;
reserved 3, 13;
}
......@@ -8,10 +8,13 @@ package feedwire;
option optimize_for = LITE_RUNTIME;
import "components/feed/core/proto/v2/wire/capability.proto";
// UNUSED_IN_CHROME import
// "components/feed/core/proto/v2/wire/capability.proto";
import "components/feed/core/proto/v2/wire/chrome_feed_response_metadata.proto";
import "components/feed/core/proto/v2/wire/data_operation.proto";
import "components/feed/core/proto/v2/wire/feed_id.proto";
import "components/feed/core/proto/v2/wire/response_status_code.proto";
// UNUSED_IN_CHROME import "components/feed/core/proto/v2/wire/feed_id.proto";
// UNUSED_IN_CHROME import
// "components/feed/core/proto/v2/wire/response_status_code.proto";
// A feed response is a series of directives to manipulate backend storage,
// similar to database commands. Individual data operations contain all the
......@@ -23,23 +26,14 @@ message FeedResponse {
// Metadata for the entire FeedResponse.
optional FeedResponseMetadata feed_response_metadata = 2;
// The list of server-response supported capabilities.
repeated Capability server_capabilities = 3;
// The status code for this response.
optional ResponseStatusCode response_status_code = 4;
// UNUSED_IN_CHROME repeated Capability server_capabilities = 3;
// UNUSED_IN_CHROME optional ResponseStatusCode response_status_code = 4;
}
// Data which is relevant for the whole response made by the server.
message FeedResponseMetadata {
// Time at which the server fulfilled this response. This is needed as client
// cannot be the source of truth.
optional int64 response_time_ms = 1;
// Created on the server and used by the client to identify the feed when
// clients will store multiple infinite feeds.
// See [INTERNAL LINK]
optional FeedId feed_id = 3;
reserved 2;
// UNUSED_IN_CHROME optional int64 response_time_ms = 1;
// UNUSED_IN_CHROME optional bytes event_id = 2;
// UNUSED_IN_CHROME optional FeedId feed_id = 3;
// UNUSED_IN_CHROME optional bool pinned_content_fulfilled = 4;
optional ChromeFeedResponseMetadata chrome_feed_response_metadata = 326233599;
}
......@@ -11,16 +11,7 @@ option optimize_for = LITE_RUNTIME;
import "components/feed/core/proto/v2/wire/duration.proto";
import "components/feed/core/proto/v2/wire/token.proto";
// InPlaceUpdateHandle is a handle for the client to send to the server in order
// to update content in-place.
message InPlaceUpdateHandle {
// Indicates how long after this response ws received the client should wait
// before sending the token back to the server. It is not an error to send the
// token earlier, but in that case the server may just replace the handle with
// and an updated use_after and the same token.
optional feedwire.Duration use_after = 1;
// Opaque token to use in a request for the server to send updated versions of
// its associated content.
optional Token token = 2;
}
// UNUSED_IN_CHROME message InPlaceUpdateHandle {
// UNUSED_IN_CHROME optional feedwire.Duration use_after = 1;
// UNUSED_IN_CHROME optional Token token = 2;
// UNUSED_IN_CHROME }
......@@ -9,15 +9,9 @@ package feedwire;
option optimize_for = LITE_RUNTIME;
// Status for the Feed response.
enum ResponseStatusCode {
UNKNOWN_STATUS_CODE = 0;
// Eligible for feed and no errors encountered.
STATUS_OK = 1;
// Ineligible for Feed.
STATUS_INELIGIBLE_FOR_FEED = 2;
// No cards.
STATUS_NO_CONTENT_RETURNED = 3;
}
// UNUSED_IN_CHROME enum ResponseStatusCode {
// UNUSED_IN_CHROME UNKNOWN_STATUS_CODE = 0;
// UNUSED_IN_CHROME STATUS_OK = 1;
// UNUSED_IN_CHROME STATUS_INELIGIBLE_FOR_FEED = 2;
// UNUSED_IN_CHROME STATUS_NO_CONTENT_RETURNED = 3;
// UNUSED_IN_CHROME }
......@@ -8,17 +8,11 @@ package feedwire;
option optimize_for = LITE_RUNTIME;
// Templates provide a way to separate formatting from content.
// Deprecated: use RenderData instead.
message Templates {
option deprecated = true;
// Enum denoting which extension contains template data.
enum TemplateType {
UNKNOWN_TEMPLATE_TYPE = 0;
XSURFACE = 1;
}
optional TemplateType template_type = 1;
extensions 264680549; // XSurfaceTemplates
}
// UNUSED_IN_CHROME message Templates {
// UNUSED_IN_CHROME enum TemplateType {
// UNUSED_IN_CHROME UNKNOWN_TEMPLATE_TYPE = 0;
// UNUSED_IN_CHROME XSURFACE = 1;
// UNUSED_IN_CHROME }
// UNUSED_IN_CHROME optional TemplateType template_type = 1;
// UNUSED_IN_CHROME extensions 264680549; // XSurfaceTemplates
// UNUSED_IN_CHROME }
......@@ -472,7 +472,5 @@ feed_response {
feed_response_metadata {
response_time_ms: 1587056924
}
server_capabilities: CARD_MENU
response_status_code: STATUS_OK
}
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