Source/WebKitLegacy/mac/ChangeLog

 12019-05-08 Daniel Bates <dabates@apple.com>
 2
 3 [Legacy WebKit] REGRESSION (r238078): Crash in hardwareKeyboardAvailabilityChangedCallback()
 4 https://bugs.webkit.org/show_bug.cgi?id=197724
 5 <rdar://problem/49725959>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Speculative fix for race condition. Between the time we receive a kGSEventHardwareKeyboardAvailabilityChangedNotification
 10 notification and when we schedule execution to run on the WebThread the WebView that notification
 11 was for may no longer exist. Take out a weak ptr on the WebView when we receive the notification
 12 and check that we still have it once we are running on the WebThread.
 13
 14 * WebView/WebHTMLView.mm:
 15 (hardwareKeyboardAvailabilityChangedCallback):
 16
1172019-04-26 Keith Rollin <krollin@apple.com>
218
319 Enable new build rule for post-processing headers when using XCBuild

Source/WebKitLegacy/mac/WebView/WebHTMLView.mm

146146#import <wtf/ObjCRuntimeExtras.h>
147147#import <wtf/RunLoop.h>
148148#import <wtf/SystemTracing.h>
 149#import <wtf/WeakObjCPtr.h>
149150
150151#if PLATFORM(MAC)
151152#import "WebNSEventExtras.h"

@@static NSString * const WebMarkedTextUpdatedNotification = @"WebMarkedTextUpdate
820821static void hardwareKeyboardAvailabilityChangedCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void*, CFDictionaryRef)
821822{
822823 ASSERT(observer);
 824 auto weakWebView = WeakObjCPtr<WebHTMLView>((__bridge WebHTMLView *)observer);
823825 WebThreadRun(^{
824  WebHTMLView *webView = (__bridge WebHTMLView *)observer;
825  if (Frame* coreFrame = core([webView _frame]))
826  coreFrame->eventHandler().capsLockStateMayHaveChanged();
 826 if (auto webView = weakWebView.get()) {
 827 if (auto* coreFrame = core([webView _frame]))
 828 coreFrame->eventHandler().capsLockStateMayHaveChanged();
 829 }
827830 });
828831}
829832#endif