WebView Prerender: Defer WebMessage from JS to browser until activation
postMessage() from JS to Java during prerendering should be deferred until prerender activation. This CL implements the logic on the components/js_injection/ layer. Messages should be queued until a page gets activated or an associated document is swapped out, while JsToBrowserMessaging that manages (queued) posted messages is a per-RenderFrameHost object that can be reused over cross-document navigation. To address this incompatibility, this CL manages the messages using DocumentUserData. To test this deferral logic, this CL moves TestWebMessageListener from JsJavaInteractionTest.java to its own file so that AwPrerenderTest.java can reuse the listener. Design doc (Google internal only): https://docs.google.com/document/d/1jIoS5pko1NGp1rRQx3dEm4StY1L8xT8CapqcDzB7Tv8/edit?usp=sharing Credit: Changes in the components/js_injection/ layer were originally written by kouhei@chromium.org. Bug: 41490450, 331592024 Change-Id: I1a1a9d96faff041eba36ac560ffcdbdf556e9094 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5385248 Reviewed-by:Kouhei Ueno <kouhei@chromium.org> Reviewed-by:
Richard (Torne) Coles <torne@chromium.org> Reviewed-by:
Rakina Zata Amni <rakina@chromium.org> Reviewed-by:
Scott Violet <sky@chromium.org> Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/main@{#1280563}
Loading
Please register or sign in to comment