MacPWAs: Trust content::NativeWebKeyboardEvent serialization to be wrong
A number of bugs have come out of the fact that
content::NativeWebKeyboardEvent appears to provide a mechanism to pass
an NSEvent across processes via
NSEvent -> content::NativeWebKeyboardEvent -> (mojo) ->
content::NativeWebKeyboardEvent -> NSEvent
In practice, the NSEvent reconstructed after the
content::NativeWebKeyboardEvent was passed over mojo is not even
remotely accurate.
Add helper functions to serialize NSEvents using the OS-provided
CGEventCreateData and CGEventCreateFromData functions. When passing a
content::NativeWebKeyboardEvent over mojo, pass the serialization
alongside it, and replace the result's os_event.
Use this approach instead of updating the mojo serialization for
content::NativeWebKeyboardEvent because we don't want to be calling
CGEventCreateFromData on data sent from the renderer process.
Remove the accumulated workarounds for these issues.
R=dominickn
TBR=avi (content/ OWNERship)
Bug: 919167, 943197, 964052, 942690
Change-Id: Ie7321229daf34629ddc9037ab733b40828bc62c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1659662
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by:
ccameron <ccameron@chromium.org>
Reviewed-by:
Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#669972}
Showing
Please register or sign in to comment