[webkit-reviews] review granted: [Bug 189621] It should be possible to get the mouse event modifiers from an injected bundle. : [Attachment 358441] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 14 09:30:28 PST 2019


Daniel Bates <dbates at webkit.org> has granted Per Arne Vollan
<pvollan at apple.com>'s request for review:
Bug 189621: It should be possible to get the mouse event modifiers from an
injected bundle.
https://bugs.webkit.org/show_bug.cgi?id=189621

Attachment 358441: Patch

https://bugs.webkit.org/attachment.cgi?id=358441&action=review




--- Comment #12 from Daniel Bates <dbates at webkit.org> ---
Comment on attachment 358441
  --> https://bugs.webkit.org/attachment.cgi?id=358441
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=358441&action=review

> Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:389
> +    // Swizzle [NSEvent modiferFlags], since it always returns 0 when the
WindowServer is blocked.

Grep the code to ensure we don’t have an existing Swizzler class or helpers.
Maybe we only have for TestWebKitAPI?

> Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:390
> +    Method method = class_getClassMethod(objc_getClass("NSEvent"),
@selector(modifierFlags));

[NSEvent class]?

> Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:391
> +    method_setImplementation(method, (IMP)currentModifierFlags);

Reinterpret_cast<>?


More information about the webkit-reviews mailing list