Remove some deprecated base::JSONWriter::Write() calls in //components

Mechanically switch from base::JSONWriter::Write() to base::WriteJson()
for callers that did not check the return value. Keep the existing
behavior and return an empty string on failure.

This CL was initially AI generated, with human touch-ups. Based on
https://crrev.com/1511773.

Bug: 443929217
Change-Id: I11cac49e0afdc47756d7b8fd5bd69cac22249600
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6934926
Commit-Queue: Lei Zhang <[email protected]>
Reviewed-by: Colin Blundell <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1513784}
NOKEYCHECK=True
GitOrigin-RevId: 37d860c058eb9c7b3b82d932fbba4cf8a2527a92
2 files changed