
As part of crrev/c/5734315 I notice there is a lot of inconsistency and duplication in how we set API keys on requests: * Some places set a URL parameter, some set the HTTP header (both are valid per https://cloud.google.com/apis/docs/system-parameters) * The header name is hard-coded in many places * Call sites don't all handle the different stable/non-stable channel keys This CL adds an API to improve on the issues above. Bug: 355544759 Change-Id: Iea4616bcbdcb10ba7d9e2dcd8ffefddd2df813be Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5730337 Auto-Submit: James Lee <ljjlee@google.com> Reviewed-by: Alex Ilin <alexilin@chromium.org> Reviewed-by: Nohemi Fernandez <fernandex@chromium.org> Commit-Queue: James Lee <ljjlee@google.com> Cr-Commit-Position: refs/heads/main@{#1334202}