Commit deeaf512 authored by Mathias Carlen's avatar Mathias Carlen Committed by Commit Bot

[Autofill Assistant] Use optional fields for protos.

Before this patch, server and client protos were not in sync with
respect to the required/optional qualifiers. This lead to obscure
failures when serializing/deserializing messages from and to the
backend.

This patch changes the remaining required fields to optional.

After this patch, we are closer to having wire identical protos.
To completely guarantee this going forward we will introduce more
tooling and sync them on a regular basis.

The fields that changed are all ElementReferenceProtos which
reduce to an empty selector when not set, which is acceptable.

R=rouslan@chromium.org, szermatt@chromium.org

Bug: 806868
Change-Id: If855ad1b882712917e3d883c9f4f607d479fc103
Reviewed-on: https://chromium-review.googlesource.com/1244677Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Commit-Queue: Mathias Carlen <mcarlen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594634}
parent 379f3578
......@@ -226,7 +226,7 @@ message ElementReferenceProto {
// Contain all arguments to perform a click.
message ClickProto {
required ElementReferenceProto element_to_click = 1;
optional ElementReferenceProto element_to_click = 1;
}
// Contain all arguments to perform a select option action.
......@@ -286,7 +286,7 @@ message UseAddressProto {
optional string prompt = 2;
// Reference to an element in the form that should be filled.
required ElementReferenceProto form_field_element = 4;
optional ElementReferenceProto form_field_element = 4;
// An optional list of fields that should be filled by this action.
repeated RequiredField required_fields = 6;
......@@ -299,14 +299,14 @@ message UseCreditCardProto {
optional string prompt = 1;
// A reference to the card number field in the form that should be filled.
required ElementReferenceProto form_field_element = 3;
optional ElementReferenceProto form_field_element = 3;
}
// Ask Chrome to wait for an element in the DOM. This can be used to only
// proceed to the next action once the page is ready.
message WaitForDomProto {
// The element to wait.
required ElementReferenceProto element = 1;
optional ElementReferenceProto element = 1;
// Fail after waiting this amount of time.
optional int32 timeout_ms = 2;
......
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