[Glic] Add server side metadata passthrough in glicPrivate.invoke [chromium/src : main]

0 views
Skip to first unread message

Tommy Nyquist (Gerrit)

unread,
Jun 25, 2026, 12:28:41 PM (12 hours ago) Jun 25
to Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, Sophie Chang, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from Sophie Chang

Tommy Nyquist added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Tommy Nyquist . resolved

sophiechang@: PTAL

Open in Gerrit

Related details

Attention is currently required from:
  • Sophie Chang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ib6ae4b678114337805ec2411e3091a519f986291
Gerrit-Change-Number: 8005551
Gerrit-PatchSet: 1
Gerrit-Owner: Tommy Nyquist <nyq...@chromium.org>
Gerrit-Reviewer: Sophie Chang <sophi...@chromium.org>
Gerrit-Reviewer: Tommy Nyquist <nyq...@chromium.org>
Gerrit-Attention: Sophie Chang <sophi...@chromium.org>
Gerrit-Comment-Date: Thu, 25 Jun 2026 16:28:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Sophie Chang (Gerrit)

unread,
Jun 25, 2026, 3:14:11 PM (9 hours ago) Jun 25
to Tommy Nyquist, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from Tommy Nyquist

Sophie Chang added 1 comment

File chrome/browser/extensions/api/glic_private/glic_private_api.cc
Line 94, Patchset 2 (Latest): const std::string* b64_value = metadata_dict->FindString(kValue);
Sophie Chang . unresolved

i dont think you need b64 unless you are actively converting it server-side?

i thought it came down in serialized bytes?

Open in Gerrit

Related details

Attention is currently required from:
  • Tommy Nyquist
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib6ae4b678114337805ec2411e3091a519f986291
    Gerrit-Change-Number: 8005551
    Gerrit-PatchSet: 2
    Gerrit-Owner: Tommy Nyquist <nyq...@chromium.org>
    Gerrit-Reviewer: Sophie Chang <sophi...@chromium.org>
    Gerrit-Reviewer: Tommy Nyquist <nyq...@chromium.org>
    Gerrit-Attention: Tommy Nyquist <nyq...@chromium.org>
    Gerrit-Comment-Date: Thu, 25 Jun 2026 19:13:52 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Tommy Nyquist (Gerrit)

    unread,
    Jun 25, 2026, 6:55:31 PM (5 hours ago) Jun 25
    to Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, Sophie Chang, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Sophie Chang

    Tommy Nyquist voted and added 1 comment

    Votes added by Tommy Nyquist

    Commit-Queue+1

    1 comment

    File chrome/browser/extensions/api/glic_private/glic_private_api.cc
    Line 94, Patchset 2 (Latest): const std::string* b64_value = metadata_dict->FindString(kValue);
    Sophie Chang . unresolved

    i dont think you need b64 unless you are actively converting it server-side?

    i thought it came down in serialized bytes?

    Tommy Nyquist

    Because Chrome requests this data as HTTP/JSON (`application/json`), the server response undergoes OnePlatform transcoding.

    If we were to use standard `google.protobuf.Any`:

    • If unregistered in the transcoder registry: The transcoder fails to resolve the type URL and aborts the request with an HTTP 500 error ("unknown type").
    • If registered: The transcoder automatically unpacks the `Any` payload into a nested JSON object (using `@type`).

    Since Chromium parses the outer response dynamically as a JSON dictionary to avoid compiling the outer `GetPromptForWebPropertyResponse` proto wrapper, it cannot easily parse this unpacked structured JSON back into a raw protobuf blob without local descriptors.

    Using `SerializedAny` (flat `string type_url` and `bytes value`) forces the transcoder to treat the payload as standard fields, representing the payload as base64-encoded bytes. Chrome can then easily decode the base64 and reconstruct `optimization_guide::proto::Any` using descriptors it already has.

    Alternative Considered (Binary Protobuf): We could bypass JSON transcoding entirely by requesting binary data (`Accept: application/x-protobuf`) and using `google.protobuf.Any` directly. However, this would require importing and compiling the outer `GetPromptForWebPropertyResponse` proto definitions directly into Chromium, which I'm not sure we want to do as part of it. But I guess we have to decide before we submit these changes!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sophie Chang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib6ae4b678114337805ec2411e3091a519f986291
    Gerrit-Change-Number: 8005551
    Gerrit-PatchSet: 2
    Gerrit-Owner: Tommy Nyquist <nyq...@chromium.org>
    Gerrit-Reviewer: Sophie Chang <sophi...@chromium.org>
    Gerrit-Reviewer: Tommy Nyquist <nyq...@chromium.org>
    Gerrit-Attention: Sophie Chang <sophi...@chromium.org>
    Gerrit-Comment-Date: Thu, 25 Jun 2026 22:55:19 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Sophie Chang <sophi...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages