Reland "Replace String with WebMessagePayload for AndroidX WebMessage API"

This is a reland of commit bc7514a7cf7b67ffc3fb0698310a23246df5a7c5

- Keep WebContents#postMessageToMainFrame(String, ...), it's used
by downstream.

Original change's description:
> Replace String with WebMessagePayload for AndroidX WebMessage API
> Design doc:
> This CL did not add new features.
> - Add a new boundary type WebMessagePayload to replace String
> WebMessage.getData().
> - Add new data class MessagePayload in content/, and replace existing
> PostMessage API with the new type.
> - A followup change will add ArrayBuffer support in
> WebViewCompat.postMessageToMainFrame and
> WebChannelCompat.postMessage.
> How to test: run tests in existing AndroidX Webkit.
> Bug: 1023334
> Change-Id: Ib5b35b974bee597a6efada75503c5288f7058c50
> Reviewed-on:
> Reviewed-by: Bo Liu <>
> Reviewed-by: Richard Coles <>
> Reviewed-by: Peter Conn <>
> Commit-Queue: Linyue He <>
> Cr-Commit-Position: refs/heads/main@{#995852}

Bug: 1023334
Change-Id: I9e2fa991d04e575add848d908a5d097a35a990b2
Reviewed-by: Bo Liu <>
Commit-Queue: Linyue He <>
Reviewed-by: Richard Coles <>
Reviewed-by: Peter Conn <>
Cr-Commit-Position: refs/heads/main@{#997137}
GitOrigin-RevId: 173c29edc14315e542c0c497d0d5bee5c718a289
3 files changed
tree: 856a521e3ab08bb8e8a232d247e59e0362aa4923
  1. java/


This folder contains a shim layer between the public frameworks APIs (android.webkit.*) and WebView's implementation, and allows them to (mostly) not directly depend on each other.

Folder Dependencies

//android_webview/java/ must not depend on this directory.

See Also